zoukankan      html  css  js  c++  java
  • Mac OS X系统下的Android环境变量配置

    在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,大功告成!

  • 相关阅读:
    服务器被黑

    ZXW说
    抽象类
    URL参数加密解密过程
    SqlServer 跨服务器 DML
    发布
    C#操作XML小结
    定时指执程序
    SQL语句判断数据库、表、字段是否存在
  • 原文地址:https://www.cnblogs.com/zzsdream/p/6393480.html
Copyright © 2011-2022 走看看