了解更多,访问:CSDN博主Dongs丶的文章adb下载安装及使用
常见命令
启动 adb server 命令:adb start-server
停止 adb server 命令:adb kill-server
查询已连接设备/模拟器:adb devices
adb devices 命令经常出现以下问题:
offline —— 表示设备未连接成功或无响应;
device —— 设备已连接;
no device —— 没有设备/模拟器连接;
List of devices attached 后面为空 —— 设备/模拟器未连接到 adb 或无响应
1、连接夜神模拟器
adb connect 127.0.0.1:62001
2、连接检查:
adb devices
list 列表中出现内容表示连接成功
3、关闭连接
当某个端口已经有连接占用时,该端口上无法再开新的连接,需要先将原来占用这个端口的程序关掉
#查看端口被什么进程占用
netstat -aon | findstr "端口号"
#查看进程的任务名
tasklist | findstr "进程号"
#关掉进程
taskkill /f /pid 进程号
其他
#push 文件到手机
adb push D:\czg\mobileData\czgQrCode.jpg /sdcard/czgDownload
adb push F:\1.png storage/emulated/legacy/DCIM/Camera/
#push 目录到手机 mobileData这个目录copy--》到 收集sd卡的czgDownlaod目录
adb push D:\czg\mobileData /sdcard/czgDownload/
adb push D:\czg\czgDownload /sdcard/
#pull 手机文件到电脑(注意在git Bash命令行不能使用哦)
adb pull /sdcard/czgDownload/EnMicroMsg.db d:/czg/
#开启服务
am startservice -n com.zan.input/com.zan.input.service.ImageService
#连接主机[:PORT]通过TCP/IP连接到设备[默认端口=5555] -比如华为云手机
adb connect 127.0.0.1:1234
#更新手机图库
高
adb shell am broadcast -a android.intent.action.MEDIA_SCANNER_SCAN_FILE -d file:///storage/emulated/0/DCIM/Camera/
低
adb shell am broadcast -a android.intent.action.MEDIA_MOUNTED -d file:///storage/emulated/legacy/DCIM/Camera/
#adb shell 如何选择特定的设备
adb devices #显示都有哪些设备连接
adb -s emulator-5556 shell {command} 发送指定命令
#ADB很强大,记住一些ADB命令有助于提高工作效率
https://zmywly8866.github.io/2015/01/24/all-adb-command.html
查看Android 手机的arm版本
#查看cpu
adb shell getprop ro.product.cpu.abi
#其他信息
adb shell cat /system/build.prop
adb shell cat /proc/cpuinfo
#查看是否是armeabi-v7a等
getprop|grep arm