好久没用android了今天重新试一下

142 阅读1分钟

mac上使用android studio进行手机调试

1、在终端输入 cd ~ 进入用户目录
2、使用 touch .bash_profile 创建.bash_profile文件
3、使用 open -e .bash_profile 打开.bash_profile文件4、在.bash_profile中添加 android sdk路径。 image.png

image.png

4、 保存并退出, source .bash_profile 命令刷新使其生效。
5、终端输入 system_profiler SPUSBDataType,在信息中找到 Vendor ID image.png

6、创建,修改adb_usb.ini文件。
7、输入 vi ~/.android/adb_usb.ini 命令,按i进入编辑模式。加入Vendor ID保存,并使用:wq命令退出。 image.png

8、终端关闭重启adb
adb kill-server
adb start-server
9、手机一定要先打开开发者模式,然后再打开USB调试,不然adb链接不上。