1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ターミナルからAndroidアプリをビルドしてインストールして起動するスクリプト

Posted at

いつもAndroidアプリをビルドする時、ターミナルからadbコマンド叩く派なんですがめんどくさかったので今更ながら
ビルドしてインストールして起動するスクリプト書いた

ついでにビルドしてそのまま気づいたら終わってたってことが結構あるので通知も飛ばしてくれるようにした(Macのみ)

# !/bin/bash

ROOT=`pwd`

$ROOT/gradlew assembleDebug
adb install -r $ROOT/app/build/outputs/apk/app-debug.apk
adb shell am start -n "com.sample/com.sample.activities.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
osascript -e 'display notification "finish" with title "Build and Install Debug App"'

これをてきとうにコマンドにしてプロジェクトルートで叩けば動くはず。
アプリ起動部分のIntentはてきとうに書き換えてください。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?