adb命令提示符
常用命令
adb devices查看连接设备
adb -s cf27456f shell指定连接设备使用命令
adb install test.apk安装应用
adb install -r demo.apk安装apk 到sd 卡
adb uninstall cn.com.test.mobile卸载应用,需要指定包
adb uninstall -k cn.com.test.mobile卸载app 但保留数据和缓存文件
adb shell pm list packages列出手机装的所有app 的包名
adb shell pm list packages -3列出除了系统应用的第三方应用包名
adb shell pm clear cn.com.test.mobile清除应用数据与缓存
adb shell am start -ncn.com.test.mobile/.ui.SplashActivity启动应用
adb shell dumpsys package包信息Package Information
adb shell dumpsys meminfo内存使用情况Memory Usage
adb shell am force-stop cn.com.test.mobile强制停止应用
adb logcat查看日志
adb logcat -c清除log 缓存
adb reboot重启
adb get-serialno获取序列号
adb shell getprop ro.build.version.release查看Android 系统版本
adb shell top -s 10查看占用内存前10 的app
adb push <local> <remote>从本地复制文件到设备
adb pull <remote> <local>从设备复制文件到本地
adb bugreport查看bug 报告
adb help查看ADB 帮助
常用
adb devices#查看连接设备
adb shell pm list packages#列出手机装的所有app 的包名
adb shell pm list packages -3#列出除了系统应用的第三方应用包名
adb shell getprop ro.build.version.release#查看Android 系统版本
adb shell dumpsys package#包信息Package Information
adb shell dumpsys activity recents | find “intent={”#查找APP的appPackage、appActivity
adb shell dumpsys activity | find “mResumedActivity”查找真机正在运行APP的appPackage、appActivity
adb kill-server、adb start-server、adb remount
adb配置代理
配置代理命令如下:
adb shell settings put global http_proxy [ip_address:port]
示例,以ip 192.168.1.200 端口 3128为例( 实际配置时以你的代理为准 ):
adb shell settings put global http_proxy 192.168.1.200:3128
移除代理
取消代理命令如下,3条都需要执行:
adb shell settings delete global http_proxy
adb shell settings delete global global_http_proxy_host
adb shell settings delete global global_http_proxy_port