Appium学习笔记(一)-3.adb常见命令

一、获取应用程序的包名和界面名

1.获取系统中应用程序

windows: adb shell dumpsys window windows | findstr mFoucusedApp

 

 包名:com.android.settings

启动页面:Settings

 

2.文件传输

电脑传文件给手机:

adb push d:\test.txt /sdcard

adb pull /sdcard/test.text e:\test

 

3.获取app启动时间

adb shell am start -w com.android.settings/Settings

启动完后结果如下:

 

 

 

 

 

 

4.获取手机日志命令

adb logcat

可以实时监控手机操作的日志。

当发现Bug时,可以使用该命令找bug,并将 E/at 的日志信息记录下来。

 

5.其他命令:

 

5.1 安装apk   adb install 路径/xx.apk 

e.g: adb install d:\download\4.1.8.apk

 

5.2 卸载apk adb uninstall 包名

e.g: adb uninstall com.xxxx.mall

 

5.3 查看当前电脑连接设备列表:

e.g: adb devices

 

5.4 进入android手机内部linux系统命令行中

e.g: adb shell

从windows系统进入对应设备的linux系统中

 

 

退出: exit

 

5.5 windows下启动和关闭 adb服务

adb start-server

adb kill-server

 

5.6 帮助:

adb --help

 

 

 

 

 

 

posted @ 2021-08-10 11:59  kaer_invoker  阅读(63)  评论(0编辑  收藏  举报