将SDK工具添加到Android Studio应用中的路径 [英] Add SDK tools to path in Android Studio app

查看:135
本文介绍了将SDK工具添加到Android Studio应用中的路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚安装了Android Studio 0.2.2.我想将SDK工具添加到$PATH(位于此文件夹中):

I have just installed Android Studio 0.2.2. I want to add the SDK tools to the $PATH, which are in this folder:

/Applications/Android\ Studio.app/sdk/tools

这样我就可以将它们与电话缺口.

so that I can use them with e.g. Phonegap.

但是将这个文件夹添加到$PATH之后,它仍然会说:

But after I add this folder to the $PATH, it still keeps saying:

android:找不到命令

android: command not found

奇怪的是,即使我cd到该文件夹​​并键入其名称,我也无法运行该文件夹中的任何可执行文件.

Oddly, I can't run any of the executables in that folder even when I cd to that folder and type their names.

我在做什么错了?

推荐答案

似乎新版本的Android Studio并未与SDK捆绑在一起.因此,/Applications/Android\ Studio.app/sdk/tools将不再起作用.

It seems that newer versions of Android Studio don't come bundled with the SDK. So, /Applications/Android\ Studio.app/sdk/tools will no longer work.

从Android Studio启动SDK Manager之后,我意识到新路径是 /Users/$USER/Library/Android/sdk/tools.

After launching the SDK Manager from Android Studio, I realized the new path is /Users/$USER/Library/Android/sdk/tools.

  1. 通过在终端上发出命令open ~/.bash_profile打开~/.bash_profile文件

在该文件的末尾添加以下行

Add the following lines to the end of that file

  1. export PATH=/Users/$USER/Library/Android/sdk/tools:$PATH
  2. export PATH=/Users/$USER/Library/Android/sdk/tools/bin:$PATH
  3. export PATH=/Users/$USER/Library/Android/sdk/platform-tools:$PATH
  1. export PATH=/Users/$USER/Library/Android/sdk/tools:$PATH
  2. export PATH=/Users/$USER/Library/Android/sdk/tools/bin:$PATH
  3. export PATH=/Users/$USER/Library/Android/sdk/platform-tools:$PATH

  • 保存并关闭~/.bash_profile文件

    如果要使更改在当前终端上生效,则source ~/.bash_profile;否则,请关闭并重新打开终端,更改将自动进行

    If you want the changes to take action on the current terminal, then source ~/.bash_profile; otherwise, close and re-open the terminal, and the changes will take place automatically

    这篇关于将SDK工具添加到Android Studio应用中的路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆