adb常用命令

嘻嘻

adb无法安装debug包,提示Failure [INSTALL_FAILED_TEST_ONLY],怎么办?莫慌,加个-t参数即可

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
$ adb install -t debug.apk

这一点在adb的说明中有明确的提示, -t 即表示允许test package
$ adb
......
app installation:
install [-lrtsdg] PACKAGE
install-multiple [-lrtsdpg] PACKAGE...
push package(s) to the device and install them
-l: forward lock application
-r: replace existing application
-t: allow test packages
-s: install application on sdcard
-d: allow version code downgrade (debuggable packages only)
-p: partial application install (install-multiple only)
-g: grant all runtime permissions

1、设备名

1
2
3
~adb devices
List of devices attached
33b794ea0504 device

2,获取最上方Aty

1
2
$ adb shell dumpsys activity | grep "mFocusedActivity"
mFocusedActivity: ActivityRecord{5bef6d8 u0 com.miui.home/.launcher.Launcher t1803}

3,通过adb获取设备IMEI:iphonesubinfo

1
2
$ adb shell service call iphonesubinfo 1 | awk -F "'" '{print $2}' | sed '1 d' | tr -d '.' | awk '{print}' ORS=
872429031076264

4,分辨率

1
2
$ adb shell wm size
Physical size: 1080x1920

5,adb uninstall 包名

文章目录