Android adb 相关指令

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/DHGhh/article/details/77988744

Android adb 相关指令

  • 连接 adb connect ip
  • 断开 adb kill-server 或 adb disconnect
  • 查看连接设备 adb devices
  • 查看当前Activity adb shell dumpsys window | grep mCurrentFocus
  • 打开一个Activity adb shell am start -n com.xxx.xxx/.xx.xxActivity (-d data值)
  • 打开一个Service adb shell am startservice -n com.xxx.xxx/.xx.xxService

记录

1、杀死某个进程,并重启服务

adb shell
ps | grep 包名
kill 8043
adb shell am startservice -n 包名/.MainService

2、推送文件

adb push [-s ip/设备名] /Users/hh/b /sdcard
adb push [-s ip/设备名] /Users/hh/test.jpg /sdcard

猜你喜欢

转载自blog.csdn.net/DHGhh/article/details/77988744