Tips for making build faster without Instant Run

Tips for making build faster without Instant Run

Tips for making build faster without Instant Run.

860bf040d996601213e05747dd661c23?s=128

Tomoaki Imai

July 15, 2016
Tweet

Transcript

  1. 2.

    twitter: @tomoaki_imai github: tomoima525 ࠓҪ ஐষ Android Engineer 2016.1 transfered

    to Mercari@US ඒຯ͍͠ΧϨʔͷΑ͏ʹ ਓΛ޾ͤʹग़དྷΔΑ͏ʹͳΓ͍ͨ
  2. 8.
  3. 13.

    // Notify after build is completed alias noti='terminal-notifier -message “done!!"'

    alias gudn='./gradlew --offline assembleUsDev && noti’ Build & Notify https://github.com/julienXX/terminal-notifier
  4. 15.

    /** Build **/ alias gudd=‘gud /** Show the latest ask

    **/ && ls -lt ${AND_STD_DIR}/app/apk/ Build & Install & Notify
  5. 16.

    /** Build **/ alias gudd=‘gud /** Show the list of

    apks **/ && ls -lt ${AND_STD_DIR}/app/apk/ /** The latest apk **/ | head -n 2 Build & Install & Notify
  6. 17.

    Build & Install & Notify /** Build **/ alias gudd=‘gud

    /** Show the list of apks **/ && ls -lt ${AND_STD_DIR}/app/apk/ /** The latest apk **/ | head -n 2 /** Fetch the apk name **/ | awk '\''{print $9}'\''
  7. 18.

    Build & Install & Notify /** Build **/ alias gudd=‘gud

    /** Show the list of apks **/ && ls -lt ${AND_STD_DIR}/app/apk/ /** The latest apk **/ | head -n 2 /** Fetch the apk name **/ | awk '\''{print $9}'\'' /** Install **/ | xargs -Immm adb install -r ${AND_STD_DIR}/app/apk/mmm
  8. 19.

    /** Build **/ alias gudd=‘gud /** Show the list of

    apks **/ && ls -lt ${AND_STD_DIR}/app/apk/ /** The latest apk **/ | head -n 2 /** Fetch the apk name **/ | awk '\''{print $9}'\'' /** Install **/ | xargs -Immm adb install -r ${AND_STD_DIR}/app/apk/mmm /** Nofity when everything is done **/ && noti' Build & Install & Notify
  9. 20.

    /** Install **/ alias insl=‘gud && ls -lt ${AND_STD_DIR}/app/apk/ |

    head -n 2 | awk '\''{print $9}'\''| xargs -Immm adb install -r $ {AND_STD_DIR}/app/apk/mmm’ Build & Install & Launch & Nofity = Self Instant Run
  10. 21.

    /** Install **/ alias insl=‘gud && ls -lt ${AND_STD_DIR}/app/apk/ |

    head -n 2 | awk '\''{print $9}'\''| xargs -Immm adb install -r $ {AND_STD_DIR}/app/apk/mmm’ /** Launch **/ alias gudl=‘insl && adb shell am start com.mercariapp.mercari.dev/ com.kouzoh.mercari.activity.SplashActivity && noti' Build & Install & Launch & Nofity = Self Instant Run
  11. 22.

    • Good ! • ·͋·͋଎͍(--offlineޮՌ) • Ξπ͘ͳ͍(javaͷprocessͷΈ) • ଞͷ࡞ۀ͕ḿΔ(஗͘ͳΒͳ͍ɺ௨஌དྷΔ) •

    Bad • ඞͣLaunchը໘ʹ໭ͬͯ͠·͏ Build & Install & Launch & Nofity = Self Instant Run
  12. 24.
  13. 25.
  14. 27.

    Ingredients and Process • Ingredients ‣ build.gradle ( + proguard)

    ‣ Remove unused feature dependencies ‣ Application.java ‣ AndroidManifest.xml ‣ res/ ‣ utils/, lang/, Base Classes • Process ‣ Mix everything into new project(10min) ‣ Remove errors (50-60min)