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

Androidアプリケーションのビルド体験をリモートインスタンスで改善する

yagi
February 01, 2017

 Androidアプリケーションのビルド体験をリモートインスタンスで改善する

Enjoy Android Application Development !

yagi

February 01, 2017
Tweet

More Decks by yagi

Other Decks in Technology

Transcript

  1. ϦϞʔτϏϧυͷงғؾ Local Machine ᶃ sync code Remote Machine ᶄ build

    ᶅ get apk ᶆ install apk & launch activity Ϗϧυͷ෦෼ΛϦϞʔτϚγϯʹҕৡ͢Δ͜ͱͰ ϩʔΧϧϚγϯͷϦιʔεΛઐ༗͠ͳ͍
  2. ϦϞʔτϏϧυ༻ͷ εΫϦϓτΛ༻ҙ͢Δ GBCSJDΛ࢖ͬͨྫ @task def build(): build_dir = tmp_dir +

    package sync(build_dir) gradle_cmd = assemble_command() apk_name = apk_name_format() # run gradlew on remote instance with cd(build_dir): run(gradle_cmd) # get apk local("mkdir -p " + module + "/build/outputs/apk/") get(remote_path=build_dir + "/" + module + "/build/outputs/apk/" + apk_name, local_path=module + "/build/outputs/apk/") # start App local("adb" + " push ./" + module + "/build/outputs/apk/" + apk_name + " /data/local/tmp/" + package) local("adb" + " shell pm install -r '/data/local/tmp/" + package + "'") local("adb" + " shell am start -n '" + package + "/" + launch_activity + "' -a android.intent.action.MAIN -c android.intent.category.LAUNCHER")
  3. ίετͱ޻෉ w େମշదͳεϖοΫ w ($1OIJHIDQV ถࠃ I w "84DYMBSHF ౦ژ

    I w ͣͬͱىಈͬ͠ͺͳ͠ͷ৔߹ֹ݄ w ($1 w "84
  4. ࣗಈγϟοτμ΢ϯ w $MPVE8BUDIΛ࢖ͬͨࣗಈγϟοτμ΢ϯ "84  w ͖͍͠஋Λz࣌ؒʹର͢Δ$166UJMJ[BUJPO $166UJMJ[BUJPO zͰઃఆ w

    ΞΫγϣϯͱͯ͠γϟοτμ΢ϯΛઃఆ w ىಈ͸GBCSJDͰCPUPΛ࢖ͬͯϏϧυ࣌ʹ௚઀"1* Λୟ͘ w ($1͸DSPO࢓ࠐΉͱ͔ʹͳΓͦ͏ɻHDMPVEͰىಈ
  5. $ZCPSH#VJMEͷ࢓૊Έ Local Machine GCS Bucket Cyborg-Build.com Remote Instance ᶃrsync code

    ᶄbuild request ᶅremote op ᶆrsync code ᶇbuild on docker ᶈupload artefacts ᶉdownload artefacts ᶊinstall & launch ϩάΠϯͨ͠(PPHMFΞΧ΢ϯτͱDZCPSHCVJMEDPNͷΈ͕ιʔείʔυʹ৮ΕΔߏ଄