官术网_书友最值得收藏!

Time for action – editing PATH on Mac OS

If you're using Mac OS, your PATH variable can read paths from your .bash_profile script. If you aren't familiar with it, you may not have one yet; so in that case, you'll need to create it by performing the following steps:

  1. Start up the Terminal and enter cd ~/ to navigate to your home folder.
  2. Type touch .bash_profile to create it.
  3. Enter open -e .bash_profile to open it for editing.

Once you have your bash profile open, add the following lines to it:

export ANDROID_HOME="~/Development/adt-bundle-mac-x86_64"
export PATH=$PATH:$ANDROID_HOME/sdk/tools
export PATH=$PATH:$ANDROID_HOME/sdk/platform-tools

Tip

If you've changed your default shell from bash to a different shell, your profile may be named differently. For instance, if you're using zsh, you'll want to edit ~/zshrc instead of ~/.bash_profile. Check your shell's documentation for the exact name and location of the profile file.

Now that you've edited your PATH variable, you'll want to refresh it by typing the following command:

source ~/.bash_profile

To ensure the new directories were added to the PATH variable correctly, write the following line to display the PATH variable:

echo $PATH

After verifying that your PATH variable contains the directories that we added in this section, prepare for the next step by starting the Android SDK manager with the following command, and then close the Terminal:

android sdk

What just happened?

You've just edited your PATH variable permanently by adding a few directories to PATH in your profile file, which is loaded every time the computer starts up, so you'll never need to edit it again. Your profile is typically a hidden file starting with a period, and its specific name depends on whatever shell you're running (usually bash, by default).

Adding the Android package directories to your PATH variable enables you to send commands to the OUYA console using the Mac OS Terminal, which will be a useful tool when you get into development.

The next tutorial outlines how to make this change on a Windows computer. Feel free to skip over it and advance to the section titled Installing packages with the Android SDK if you don't have a Windows computer or don't wish to develop on it at this point in time.

主站蜘蛛池模板: 来安县| 凤凰县| 芜湖市| 公主岭市| 开江县| 舞钢市| 桓仁| 天柱县| 湾仔区| 新和县| 临清市| 柏乡县| 河池市| 高邮市| 阿拉善左旗| 和田市| 忻州市| 库伦旗| 黎川县| 许昌县| 大庆市| 盐城市| 安达市| 前郭尔| 石渠县| 廉江市| 彰武县| 印江| 江北区| 武川县| 金秀| 墨竹工卡县| 双柏县| 阳信县| 迁安市| 忻城县| 法库县| 揭西县| 瓦房店市| 泸州市| 库伦旗|