常用命令:
adb help | 查看各个参数的用法 |
adb devices | 已连接的设备列表 |
adb root | 获取设备的root权限,需要设备已经具有root权限 |
adb shell | 登录到设备终端 |
adb shell < 命令> | 执行终端命令 |
adb push <发送的文件> <存放目录> | 将文件发送到设备 |
adb pull <接收的文件> <存放目录> | 从设备获取文件 |
adb install <应用程序> | 发送并安装应用程序 |
adb uninstall <应用程序> | 卸载应用程序 |
adb bugreport | 查看bug报告 |
adb logcat | 查看日志 |
常见问题:
1、当有多台设备连接时,选择特定设备
首先查看设备名,下面我连接了虚拟机和一台真机
指定设备非常简单,只要使用 -s <设备名> 就行了
下面为登录到443068e的shell
2、上传文件出错 remote couldn't create file: Read-only file system
yu-> adb -s 443068e push healthd /system/bin/
adb: error: failed to copy 'healthd' to '/system/bin/healthd': remote couldn't create file: Read-only file system
healthd: 0 files pushed. 6.4 MB/s (76552 bytes in 0.011s)
原因是没有写权限,解决办法参考另一篇博客
https://blog.youkuaiyun.com/ljx_ahut/article/details/96479004