Created
November 8, 2012 09:47
-
-
Save hackugyo/4037845 to your computer and use it in GitHub Desktop.
Androidアプリをビルドして起動するスクリプト(複数実機対応) ref: http://qiita.com/items/3942bb6b1d6eb8a7da46
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MY_DIRNAME=$(dirname $0) | |
cd $MY_DIRNAME | |
cd YOUR_APP_DIR | |
echo "インストール先を選んでください" | |
# sedで余計な文字列を削除し,selectでANSに選ばれた選択肢を入れる | |
select ANS in `adb devices | sed -e "s/List of devices attached//" | sed -e "s/device//"` | |
# 入力値が適切な値かどうかチェック | |
do | |
if [ -z "$ANS" ]; then | |
continue | |
else | |
break | |
fi | |
done | |
echo $ANS | |
# debugbuildしてインストール | |
# http://www.alittlemadness.com/2010/06/15/android-ant-builds-targeting-a-specific-device/ | |
export ANDROID_SERIAL=$ANS | |
ant debug install | |
# 起動 | |
adb -s $ANS shell am start -a android.intent.action.MAIN -n YOUR_MAIN_ACTIVITY | |
# BUILD FAILEDなどを見るために,ターミナルを閉じずにキー入力を待つ | |
read null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment