65Android 调试桥 (adb)命令

Android 调试桥 (adb)

网络连接

通过TCP/IP连接设备

adb connect <ip:port>

断开已有的TCP/IP连接

adb disconnect <ip:port>

监听设备上指定的端口号

adb tcpip <port> 

文件操作

拉取文件至本地

adb pull <文件的设备路径> <文件的本地路径> 

推动文件至设备

adb push <文件的本地路径> <文件的设备路径> 

调试相关

启动ADB服务

adb start-server 

关闭ADB服务

adb kill-server 

查看设备日志,具体参数可通过adb logcat --help查看

adb logcat <options> <filter> 

安装卸载

安装应用

adb install <options> <package>

卸载应用

adb uninstall <options> <package> 

性能相关

查看进程

adb shell ps  

实时查询资源占用情况

adb shell top 

查看CPU信息

adb shell dumpsys cpuifo 

查看内存信息

adb shell dumpsys meminfo 

查看电池信息

adb shell dumpsys battery 

执行Monkey测试,具体参数可通过adb shell monkey查看

adb shell monkey -p <package> <options>

应用包管理

查看应用列表

adb shell pm list packages 

清除应用缓存

adb shell pm clear <package> 

其他命令

进入Shell模式

adb shell  

截屏

adb shell screencap <options> <filename> 

录屏

adb shell screenrecord <options> <filename> 

查看手机IP地址

adb shell ifconfig 

参考资料

posted @ 2023-02-04 11:21  __username  阅读(35)  评论(0编辑  收藏  举报

本文作者:DIVMonster

本文链接:https://www.cnblogs.com/guangzan/p/12886111.html

版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。