File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed
Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ # 获取设备当前应用,存放于app目录下
4+
5+ # 获取设备当前应用的包名
6+ pkgname=` adb shell dumpsys window w | grep \/ | grep name= | cut -d = -f 3 | cut -d / -f 1`
7+
8+ # 获取应用的apk路径
9+ pkgpath=` adb shell pm list packages -f $pkgname | cut -d : -f 2 | cut -d = -f 1`
10+
11+ # apk存放目录
12+ dir=app
13+ if [ ! -d " $dir " ]
14+ then
15+ mkdir $dir
16+ fi
17+
18+ # pull apk
19+ echo start pull $pkgname
20+ ` adb pull $pkgpath $dir `
21+ echo Completed
22+
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ # 获取设备当前应用的Activity,打印在控制台
4+ adb shell dumpsys window w | grep \/ | grep name= | cut -d = -f 3 | cut -d \) -f 1
5+
6+ # 将结果写入currentActivity.txt文件中
7+ # adb shell dumpsys window w | grep \/ | grep name= | cut -d = -f 3 | cut -d \) -f 1 > currentActivity.txt
You can’t perform that action at this time.
0 commit comments