Mac Android Studio提示adb: command not found

来源:互联网 发布:橱柜设计软件 编辑:程序博客网 时间:2024/05/19 06:14


1、打开Android Studio 启动终端 Terminal;

2、进入当前用户home目录(命令输入 echo $HOME);

3、创建.bash_profile文件(命令输入 touch .bash_profile);

4、打开.bash_profile文件(命令输入 open -e .bash_profile);

5、在打开的.bash_profile文件中编辑如下:

     export PATH=${PATH}:你电脑sdk的路径/tools:你电脑sdk的路径platform-tools

    编辑完成之后,保存,退出;

6、执行命令 source .bash_profile;

7、再输入,adb version 输出Android Debug Bridge version 1.0.32;

     就不会再提示adb: command not found;此时android studio adb 已配置成功;


注意:如果下次仍会出现adb:command not found; 执行2,并查看.bash_profile文件是否存在,如果存在,再执行6;


以下为常用的命令:

adb的全称为Android Debug Bridge,就是起到调试桥的作用。通过 adb 我们可以在IDE中通过DDMS来调试Android程序,其实也就是debug工具。
下面列出 adb 常用的一些命令:

  1. 查看adb版本: adb version
  2. 查看所有设备: adb devices
  3. 安装指定apk: adb install <file>
  4. 卸载指定包 : adb uninstall <package>
  5. 连接设备 : adb connect [<host>[:<port>]](默认端口号是:5555)
  6. 断开设备: disconnect [<host>[:<port>]]
  7. 执行远程的shell:adb shell
  8. 执行远程shell命令: adb shell <command>
  9. 拷贝文件到设备上: adb push <local> <remote>
  10. 从设备中拷贝文件:adb pull <remote> [<local>]
  11. 查看设备所有信息: adb bugreport(包括 bug 报告)
  12. 最重要的命令: adb help 查看命令帮助,有了他所有命令都知道了,就是 so important 。



0 0
原创粉丝点击