Mac配置Android开发环境变量及工具安装图

转载:

http://blog.csdn.net/franklysun/article/details/6041517

在Mac下开发Android,要想在终端利用命令行使用adb/android等命令时,需要配置一下环境变量。

步骤:

1.首先,假设你已经下载了Android SDK,解压后安装了adb。记住sdk文件夹路径。我个人的路径为/Users/jeff/Downloads/adt-bundle-mac-x86_64/sdk/

2.在终端中输入命令,进入用户目录。我的是/Users/jeff/

[plain]  view plain copy 在CODE上查看代码片 派生到我的代码片
  1. $cd ~  

3.然后输入命令,该命令的作用是如果不存在.bash_profile文件,则创建该文件

[plain]  view plain copy 在CODE上查看代码片 派生到我的代码片
  1. $touch .bash_profile  

4.然后输入命令,该命令的作用是用文本编辑器TextEdit打开.bash_profile文件。如果你是第一次配置环境变量,则该文档应该是空的。

[plain]  view plain copy 在CODE上查看代码片 派生到我的代码片
  1. $open -e .bash_profile  


5.下面要在该文件中加入下面的代码

1)将adb加入环境变量

[plain]  view plain copy 在CODE上查看代码片 派生到我的代码片
  1. export PATH=${PATH}:/Users/jeff/Downloads/adt-bundle-mac-x86_64/sdk/platform-tools  
2)将android/ddms/emulator/sqlite3等加入环境变量

[plain]  view plain copy 在CODE上查看代码片 派生到我的代码片
  1. export PATH=${PATH}:/Users/jeff/Downloads/adt-bundle-mac-x86_64/sdk/tools  

6.保存并退出TextEdit。关闭bash终端。

7.测试:

1)测试adb

[plain]  view plain copy 在CODE上查看代码片 派生到我的代码片
  1. $adb version  
显示

[plain]  view plain copy 在CODE上查看代码片 派生到我的代码片
  1. Android Debug Bridge version 1.0.31  
2)测试android
[plain]  view plain copy 在CODE上查看代码片 派生到我的代码片
  1. $android  
会打开Android SDK Manager窗口

OK,大功告成!

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值