我已经通过以下命令设置了指向 Android SDK 工具的路径:
# Cordova command line tools for Android SDK ----------------------
export PATH=${PATH}:/Development/adt-bundle/sdk/platform-tools:/Development/adt-bundle/sdk/tools
当我回显 $PATH 时,这就是我得到的:
/Users/lorenzoignacio/.rvm/gems/ruby-2.0.0-p0/bin:/Users/lorenzoignacio/.rvm/gems/ruby-2.0.0-p0@global/bin:/Users/lorenzoignacio/.rvm/rubies/ruby-2.0.0-p0/bin:/Users/lorenzoignacio/.rvm/bin:/usr/local/bin:/usr/local/heroku/bin:/usr/local/share/npm/bin:/Users/lorenzoignacio/.local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/git/bin:/usr/local/go/bin:/Development/adt-bundle/sdk/platform-tools:/Development/adt-bundle/sdk/tools
如果你看它的结尾,你会看到我的路径:
/Development/adt-bundle/sdk/platform-tools:/Development/adt-bundle/sdk/tools
然而,当我尝试运行时, cordova platform add android
我得到:
[Error: The command `android` failed. Make sure you have the latest Android SDK installed, and the `android` command (inside the tools/ folder) added to your path. Output: /bin/sh: android: command not found]
整个 adt-bundle 位于我的根用户目录中的一个名为Development
. 确切的路径是/Users/me/Development/adt-bundle/
我错过了什么?