-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrelease_install_apk.command
More file actions
executable file
·42 lines (34 loc) · 1.11 KB
/
release_install_apk.command
File metadata and controls
executable file
·42 lines (34 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
# カレントディレクトリをファイルのある場所に移動する
cd `dirname $0`
# echoの赤字設定
ESC=$(printf '\033') # \e や \x1b または $'\e' は使用しない
# 接続先を選ぶ
echo "Select the BuildType. 1: debug 2: release"
read type
# 接続先に応じてBuildTypeを決める
case $type in
1) buildType="Debug" ;;
2) buildType="Release" ;;
*)
echo "${ESC}[31mPlease choose 1 or 2.${ESC}[m"
exit 1
;;
esac
# インストールするアプリを選ぶ
echo "Select the app. 1: simple 2: bottombar 3: drawer"
read appId
# クリーンビルドしてapkファイルを端末へインストール
case $appId in
1) ./gradlew clean "installSimple${buildType}" ;;
2) ./gradlew clean "installBottombar${buildType}" ;;
3) ./gradlew clean "installDrawer${buildType}" ;;
*)
echo "${ESC}[31mPlease choose 1 or 2 or 3. app install failed.${ESC}[m"
exit 1
;;
esac
# apkファイルの格納ディレクトリを開く
open app/build/outputs/apk/
# コマンド終了時にターミナルを閉じる
osascript -e 'tell application "Terminal" to quit' & exit