ADB (Android Debug Bridge)
adb version -- 查看adb版本
adb -- 查看帮助
adb devices -- 查看当前已连接的设备
adb start-server -- 开启adb服务
add kill-server -- 杀死add服务
adb shell -- 进入Android控制台, 执行Linux命令
cd scared -- 进入scared目录
ls -- 查看当前目录所有文件
exit -- 退出
adb logcat -- 打印日志信息 (按 ctrl+c 停止日志打印)
adb install xxx.apk -- 安装应用
adb uninstall 报名 -- 根据包名卸载应用
adb push 文件名 手机目录+文件名
例子: adb push haha.txt /sdcard/haha.txt
解释: 将电脑当前路径下的 haha.txt 文件导入到手机中的 /sdcard/ 路径下, 并命名为haha.txt
adb pull 手机目录+文件名 电脑路径
例子: adb pull /sdcard/haha.txt .
解释: 将手机 /sdcard/ 路径下的 haha.txt 文件导出到电脑的当前路径下 (.代表当前路径)
------------------------------------------
当有多个设备的时候, 怎么pull文件到其中一个设备中?
adb -s emulator-5551 push haha.txt /sdcard/haha.txt
adb可能因为360, 金山卫士, 腾新QQ影响无法使用, 那怎么办?
1. 查看谁占用该端口
端口5037被占用
netstat -ano -- 查看谁占用端口
netstat -ano|find "5037" -- 查看占用5037端口的程序pid
netstat -ano|findstr "8080" -- 查看占用8080端口的程序pid
2. 首先找到进程号对应的进程名称
tasklist|findstr 进程号
如:tasklist|findstr 8876
3. 然后根据进程名称杀死进程
taskkill /f /t /im 进程名称
如:taskkill /f /t /im QQ.exe
或者通过任务管理器,找到pid对应的程序进程将其强制结束即可
adb version -- 查看adb版本
adb -- 查看帮助
adb devices -- 查看当前已连接的设备
adb start-server -- 开启adb服务
add kill-server -- 杀死add服务
adb shell -- 进入Android控制台, 执行Linux命令
cd scared -- 进入scared目录
ls -- 查看当前目录所有文件
exit -- 退出
adb logcat -- 打印日志信息 (按 ctrl+c 停止日志打印)
adb install xxx.apk -- 安装应用
adb uninstall 报名 -- 根据包名卸载应用
adb push 文件名 手机目录+文件名
例子: adb push haha.txt /sdcard/haha.txt
解释: 将电脑当前路径下的 haha.txt 文件导入到手机中的 /sdcard/ 路径下, 并命名为haha.txt
adb pull 手机目录+文件名 电脑路径
例子: adb pull /sdcard/haha.txt .
解释: 将手机 /sdcard/ 路径下的 haha.txt 文件导出到电脑的当前路径下 (.代表当前路径)
------------------------------------------
当有多个设备的时候怎么进入其中一个设备的shell呢?
adb -s emulator-5551 shell当有多个设备的时候, 怎么pull文件到其中一个设备中?
adb -s emulator-5551 push haha.txt /sdcard/haha.txt
adb可能因为360, 金山卫士, 腾新QQ影响无法使用, 那怎么办?
1. 查看谁占用该端口
端口5037被占用
netstat -ano -- 查看谁占用端口
netstat -ano|find "5037" -- 查看占用5037端口的程序pid
netstat -ano|findstr "8080" -- 查看占用8080端口的程序pid
2. 首先找到进程号对应的进程名称
tasklist|findstr 进程号
如:tasklist|findstr 8876
3. 然后根据进程名称杀死进程
taskkill /f /t /im 进程名称
如:taskkill /f /t /im QQ.exe
或者通过任务管理器,找到pid对应的程序进程将其强制结束即可