appium学习总结2 - 常用adb命令
·
文章目录
+3. adb杀掉appium进程,处理报错
杀掉appium的进程:
adb shell pm list packages | findstr uiauto
adb uninstall io.appium.uiautomator2.server
+2. 输出app名称和活动到 cmd 窗口
adb -s 09081JEC207669 logcat | findstr Displayed
+1. 打印所有日志到桌面 logcat.log 文件
adb -s 1e350377f6cc37a2 logcat -v time > C:\Users\mc\Desktop\logcat.log
1. 查看连接的设备:
adb devices
2. 查看app的入口
adb logcat | findstr Displayed
adb -s 09081JEC207669 logcat | findstr Displayed
adb logcat | grep Displayed 【linux】
3. 重启app
重启app到首页:
adb shell am start -W -n com.xueqiu.android/.common.splash.SplashActivity -S
adb shell am start -W -n com.xueqiu.android/.view.WelcomeActivityAlias -S
重启app到登陆界面:
adb shell am start -W -n com.xueqiu.android/.common.account.LoginActivity -S
4. 获取当前界面元素
adb shell dumpsys activity top
5. 获取任务列表
adb shell dumpsys activity activities
6. 关闭adb的后台进程
adb kill-server
7. 让android脱离USB线的TCP连接方式
adb tcpip
8. 连接开启TCP连接方式的手机
adb connect
9. 日志查看
adb logcat
10. 手机日志数据,用于后续分析比如耗电量
adb bugreport
11. adb shell:用于调用android的内置命令
> adb shell dumpsys:app重要信息,内存、耗电量、网络流量等
> adb shell dumpsys activity top:获取当前界面元素
> adb shell dumpsys activity activities:获取任务列表
> adb shell pm - 包管理工具
> adb shell pm clear com.autel.cloud.maxifix:清理缓存数据,权限就会被重置
> adb shell am:启动包
> adb shell am start -W -n com.autel.cloud.maxifix/io.dcloud.PandoraEntryActivity -S 启动app
> adb shell ps:进程相关
> adb shell monkey:兼容性测试、模拟随机事件
> adb shell "uiautomator dump && cat /sdcard/window_dump.xml":获取手机当前所展现界面的所有属性,并展现文件内容
> adb shell input tap x坐标 y坐标:模拟一次触屏事件
12. 安装、卸载包
adb install apk包
adb uninstall apk包
更多推荐
所有评论(0)