Skip to content

Commit 7299d33

Browse files
committed
Kill the app process
1 parent 27b4bd2 commit 7299d33

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

library/apkOperations.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,8 @@ function apkOperations() {
168168
clearDeviceApp $1 $apkPackageName ;;
169169
[sS][tT][oO][pP]) #stop
170170
stopDeviceApp $1 $apkPackageName ;;
171+
[kK][iI][lL][lL]) #kill
172+
killDeviceApp $1 $apkPackageName ;;
171173
[sS][tT][aA][rR][tT]) #start
172174
startDeviceApk $1 $apkPackageName ;;
173175
[rR][eE][sS][tT][aA][rR][tT]) #restart
@@ -205,6 +207,21 @@ function appPID() {
205207
fi
206208
}
207209

210+
#----- Kill
211+
function killDeviceApp() {
212+
#$1 - device serial number
213+
#$2 - package name
214+
#$return -
215+
if [ $# -lt 2 ]; then
216+
writeToLogsFile "@@ No 2 argument passed to ${FUNCNAME[0]}() in ${BASH_SOURCE} called from $( basename ${0} )"
217+
exit 1
218+
else
219+
local appProcessID = appPID $1 $2
220+
adb -s $1 shell kill $appProcessID
221+
fi
222+
}
223+
224+
208225
#----- Pull
209226
function pullDeviceApp() {
210227
#$1 - device serial

0 commit comments

Comments
 (0)