Mac安装adb和安卓adb命令使用介绍

0.配置adb

vim ~/.zshrc
-> vim ~/.bash_profile

export PATH=${PATH}:/Users/army/Library/Android/sdk/platform-tools
export PATH=${PATH}:/Users/army/Library/Android/sdk/tools

source ~/.zshrc

->  source ~/.bash_profile

1.启动系统设置

adb shell am start com.android.settings/com.android.settings.Settings

adb -s 172.16.29.112:5555 shell settings put global enable_freeform_support 1

2. 启动Shell

adb root
adb remount
adb shell

3.连接到局域网下的真机(具体地址需要通过ifconfig命令获取)

adb connect 172.16.29.124:5555

4.从设备中拉取文件/文件夹

adb pull (设备绝对路径)
例子 adb pull /storage/self/primary/Android/data/com.reachauto.poclauncher/files/Documents/Log

5.向设备推送文件/文件夹

adb push (pc上的路径) (设备绝对路径)

6.shell模式下,查看栈顶Activity

8.0之前
dumpsys activity | grep Focuse
8.0
dumpsys activity | grep "mFocusedActivity"
8.1以及之后
dumpsys activity | grep "mResume"

7.打开局域网真机的设置页面

adb -s 172.16.29.112:5555 shell am start com.android.settings/com.android.settings.Settings

只有一个真机可以使用:
adb shell am start com.android.settings/com.android.settings.Settings

8.adb 查看下载的产品文件


/storage/emulated/0/Android/data/com.poc.intelligenthardware/files/Documents/Download   

你可能感兴趣的:(语言,macos,android)