![Android SDK 无法在 OSX 上运行](https://linux22.com/image/1257006/Android%20SDK%20%E6%97%A0%E6%B3%95%E5%9C%A8%20OSX%20%E4%B8%8A%E8%BF%90%E8%A1%8C.png)
$ cd /ev-bin/android-sdk-mac_x86/tools
$ ls -al
total 8360
drwxrwx---@ 22 erikvold staff 748 Aug 28 19:43 .
drwxrwx---@ 6 erikvold staff 204 Aug 30 13:25 ..
drwxrwx---@ 5 erikvold staff 170 Aug 28 19:43 Jet
-rw-rw----@ 1 erikvold staff 195083 Aug 28 19:44 NOTICE.txt
-rwxrwxr-x@ 1 erikvold staff 171656 Aug 28 19:43 adb
-rwxrwxr-x@ 1 erikvold staff 3540 Aug 28 19:43 android
drwxrwx---@ 11 erikvold staff 374 Aug 28 19:43 ant
-rwxrwxr-x@ 1 erikvold staff 1977 Aug 28 19:43 apkbuilder
-rwxrwxr-x@ 1 erikvold staff 3265 Aug 28 19:43 ddms
-rwxrwxr-x@ 1 erikvold staff 69804 Aug 28 19:43 dmtracedump
-rwxrwxr-x@ 1 erikvold staff 1940 Aug 28 19:43 draw9patch
-rwxrwxr-x@ 1 erikvold staff 2836992 Aug 28 19:43 emulator
-rwxrwxr-x@ 1 erikvold staff 189612 Aug 28 19:43 etc1tool
-rwxrwxr-x@ 1 erikvold staff 1987 Aug 28 19:43 hierarchyviewer
-rwxrwxr-x@ 1 erikvold staff 18308 Aug 28 19:43 hprof-conv
-rwxrwxr-x@ 1 erikvold staff 1939 Aug 28 19:43 layoutopt
drwxrwx---@ 40 erikvold staff 1360 Aug 28 19:43 lib
-rwxrwxr-x@ 1 erikvold staff 17956 Aug 28 19:43 mksdcard
-rw-rw-r--@ 1 erikvold staff 33 Aug 28 19:43 source.properties
-rwxrwxr-x@ 1 erikvold staff 649368 Aug 28 19:43 sqlite3
-rwxrwxr-x@ 1 erikvold staff 3044 Aug 28 19:43 traceview
-rwxrwxr-x@ 1 erikvold staff 78472 Aug 28 19:43 zipalign
$ android
-bash: android: command not found
知道我做错了什么吗?
答案1
http://developer.android.com/sdk/installing.html
特别值得关注的是:
在 Linux 上,编辑 ~/.bash_profile 或 ~/.bashrc 文件。查找设置 PATH 环境变量的行,并将 tools/ 目录的完整路径添加到其中。如果没有看到设置路径的行,可以添加一行:export PATH=${PATH}:/tools
在 Mac OS X 上,在主目录中查找 .bash_profile,然后按照 Linux 的步骤操作。如果您的机器上尚未设置 .bash_profile,则可以创建它。
答案2
Everett 的答案是最好的解决方案。作为临时解决方案,您可以添加“./“命令之前,它们就会运行,即:
$ ./android
答案3
如果您拥有最新的 SDK,请hprof-conv
从复制platform-tools
到/tools
目录。
另外,请确保您export PATH=${PATH}:/tools
有~/.bash_profile