ADB 常用命令整理
- 安装apk
adb install [apk_path]
- 覆盖安装apk
adb install -r [apk_path]
- 卸载apk
adb uninstall [apk_package_name]
- 导出文件
adb pull [file_path] [local_path]
- 导入文件
adb push [local_path] [file_path]
- 查看当前Activity名称
adb shell dumpsys window | grep -E 'mCurrentFocus'
- 显示错误日志
adb logcat *:E
- 清楚应用数据
adb shell pm clear [packageName]
- 启动Activity
adb shell am start -W [packageName]/[ActivityName]
- 多个模拟器,指定模拟器执行
adb -s [emulator_name] install [apk_path]
- 使用Wi-Fi链接
adb usb adb tcpip 5555 adb connect 192.168.10.1:5555
- 强制停止 APP
adb shell am force-stop [packageName]