Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Tips for making build faster without Instant Run

Tips for making build faster without Instant Run

Tips for making build faster without Instant Run.

Tomoaki Imai

July 15, 2016
Tweet

More Decks by Tomoaki Imai

Other Decks in Programming

Transcript

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

    to Mercari@US ඒຯ͍͠ΧϨʔͷΑ͏ʹ ਓΛ޾ͤʹग़དྷΔΑ͏ʹͳΓ͍ͨ
  2. // 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
  3. /** Build **/ alias gudd=‘gud /** Show the latest ask

    **/ && ls -lt ${AND_STD_DIR}/app/apk/ Build & Install & Notify
  4. /** 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
  5. 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}'\''
  6. 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
  7. /** 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
  8. /** 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
  9. /** 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
  10. • Good ! • ·͋·͋଎͍(--offlineޮՌ) • Ξπ͘ͳ͍(javaͷprocessͷΈ) • ଞͷ࡞ۀ͕ḿΔ(஗͘ͳΒͳ͍ɺ௨஌དྷΔ) •

    Bad • ඞͣLaunchը໘ʹ໭ͬͯ͠·͏ Build & Install & Launch & Nofity = Self Instant Run
  11. 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)