尝试将 adb 添加到 PATH 变量 OSX [英] Trying to add adb to PATH variable OSX
问题描述
我正在尝试为 android 开发,我想将 adb
添加到我的 PATH
以便我可以轻松启动它.由于某种原因,我之前添加了目录 adb
不想被找到.这是非常令人沮丧的.有没有其他人遇到过这个问题?
I am trying to develop for android and I want to add the adb
to my PATH
so that I can launch it really easily. I have added directories before by for some reason adb
does not want to be found. This is very frustrating. Has anyone else had this problem before?
我创建了一个文件 .profile
并添加了以下内容.
I created a file .profile
and added the following to it.
export PATH = ${PATH}:/Users/simon/Libs/android-sdk-mac_x86/platform-tools/
export PATH = ${PATH}:/Users/simon/Libs/android-sdk-mac_x86/tools
当我检查我的环境路径时,我看到以下内容:
When I check my environment path I see the following:
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/Libs/android-sdk-mac_x86/tools:/Libs/android-sdk-mac_x86/platform-tools
所以我知道它已添加到我的 PATH
变量中.现在,当我尝试运行 adb
时,我发现找不到它.
So I know that it is added to my PATH
variable. Now when I try to run adb
I get that it is not found.
-bash: ./adb: No such file or directory
这非常令人沮丧.会不会是权限问题?有没有人在 OSX 和 Android 上遇到过这个问题?
This is very very frustrating. Could it be a problem with permissions? Has anyone had this problem with OSX and Android?
推荐答案
为什么要尝试运行./adb"?这完全跳过路径变量,只在当前目录中查找adb".尝试运行adb".
Why are you trying to run "./adb"? That skips the path variable entirely and only looks for "adb" in the current directory. Try running "adb" instead.
您的路径看起来不对.你说你得到
your path looks wrong. You say you get
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/Libs/android-sdk-mac_x86/tools:/Libs/android-sdk-mac_x86/platform-tools
您缺少/Users/simon 部分.
You're missing the /Users/simon part.
另请注意,如果您同时拥有 .profile 和 .bash_profile 文件,则只会执行后者.
Also note that if you have both .profile and .bash_profile files, only the latter gets executed.
这篇关于尝试将 adb 添加到 PATH 变量 OSX的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!