-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpackapk.sh
More file actions
executable file
·86 lines (74 loc) · 1.86 KB
/
Copy pathpackapk.sh
File metadata and controls
executable file
·86 lines (74 loc) · 1.86 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/bin/sh
#### 删除创建的路由文件
clean_auto_inject(){
find . -type f -name "*.sr" | xargs rm -rf
}
#### 测试渠道
pack_debug_fun() {
./gradlew clean
cleanAutoInject
./gradlew buildRelease
./gradlew assembleDebug
}
### 正式渠道
pack_release_fun() {
./gradlew clean
cleanAutoInject
./gradlew buildRelease
./gradlew assembleRelease
}
### debug渠道
pack_install_debug_fun() {
adb install app/build/outputs/apk/debug/SimpleRouter_V1.0_debug.apk
adb shell am start -n com.laydown.srouter/com.laydown.srouter.MainActivity
}
### release渠道
pack_install_release_fun() {
adb install app/build/outputs/apk/release/SimpleRouter_V1.0_release.apk
adb shell am start -n com.laydown.srouter/com.laydown.srouter.MainActivity
}
#### 帮助
if [[ "$1" == "-h" ]] || [[ "$1" == "-help" ]]
then
echo "-d,-debug : 打测试包"
echo "-r,-release : 打正式包"
echo "-id,-installDebug : 安装debug渠道包"
echo "-ir,-installRelease : 安装release渠道包"
echo "-c,-cleanAutoInject : 删除自动生成的路由文件"
exit 0
fi
#### 打debug渠道包
if [[ "$1" == "-d" ]] || [[ "$1" == "-debug" ]]
then
pack_debug_fun
### 为了测试方便直接调用安装
pack_install_debug_fun
exit 0
fi
#### 打release渠道包
if [[ "$1" == "-r" ]] || [[ "$1" == "-release" ]]
then
pack_release_fun
### 为了测试方便直接调用安装
pack_install_release_fun
exit 0
fi
#### 安装debug渠道包
if [[ "$1" == "-id" ]] || [[ "$1" == "-installDebug" ]]
then
pack_install_debug_fun
exit 0
fi
#### 安装release渠道包
if [[ "$1" == "-ir" ]] || [[ "$1" == "-installRelease" ]]
then
pack_install_release_fun
exit 0
fi
#### 删除自动生成的路由文件
if [[ "$1" == "-c" ]] || [[ "$1" == "-cleanAutoInject" ]]
then
clean_auto_inject
exit 0
fi
echo "请加上参数-h/-help查看命令信息"