appium初阶2——adb命令

adb常用命令:
1)adb version 显示adb的版本信息
2) adb devices 显示adb的设备信息
3) adb connect 127.0.0.1:62001 连接设备
4)adb install -r 绝对路径\yibijizhang.apk 命令行安装apk
5) adb -s 127.0.0.1:62001 命令 :指定手机设备进行操作某个指定;和其他命令组合使用
6)adb push 绝对路径/XX.apk /data/local/tmp 上传文件至手机指定路径
7) adb pull /data/local/tmp/yibijizhang.apk D:\ADT-Android 下载手机文件至电脑本地指定路径
8)adb shell am start -n com.miui.calculator/.cal.CalculatorActivity 命令行启动APP应用程序计算器,
亦可使用:adb shell am start -n com.miui.calculator/com.miui.calculator.cal.CalculatorActivity
打开一笔记账应用程序:adb shell am start -n com.mobivans.onestrokecharge/com.stub.stub01.Stub01

9)adb uninstall 主包名 eg:adb uninstall com.miui.calculator 卸载应用程序
11) adb kill-server:停止adb服务器
12) adb start-server:启动adb服务器

13) adb shell pm list packages查询系统的应用程序包名;adb shell pm list packages -s指定查询系统自带的包名;adb shell pm list packages -3查询第三方程序的包名
14)adb shell ps | findstr adbd 查询运行在 Android 设备上的 adb 后台进程
15)adb logcat , 打印 Android 的系统日志
16)adb bugreport > d:\bugreport.log 打印缺陷日志报告至指定文件
17)adb shell screencap -p /data/local/tmp/test001.png 屏幕截图至指定路径
18)adb shell getprop ro.serialno 获取设备序列号
19) adb get-serialno 获取设备ID号
20)adb shell monkey -p com.miui.calculator -s 999 --throttle 500 -v-v 300 每隔500毫秒执行一个事件,按随机种子ID为999,执行300次,显示详细信息
21) aapt dump badging 绝对路径/XX.apk 查询apk的包名和类名
22) adb shell monkey --pkg-whitelist-file /data/local/tmp/file.txt 1000(需要提前将文件准备好)

uiautomator2:
https://www.cnblogs.com/fnng/p/8486863.html

UIAutomation:Windows应用程序自动化测试工具
下载地址:https://github.com/blackrosezy/gui-inspect-tool

package: name='com.mobivans.onestrokecharge'
launchable-activity: name='com.stub.stub01.Stub01'

com.miui.calculator
com.miui.calculator.cal.CalculatorActivity

猜你喜欢

转载自www.cnblogs.com/bokowu/p/10494461.html