简体   繁体   中英

How to add platform android (cordova) on Mac

i have follow the instructions. phonegab docs and How to add android to cordova platform? PATH error? 出口PATH

my .bash_profile:

export PATH=/usr/local/bin:$PATH
export PATH=$PATH:~/Development/adt-bundle-mac-x86_64-20140321/sdk/platform-tools
export PATH=${PATH}:~/Development/adt-bundle-mac-x86_64-20140321/sdk/platform-tools:~/Development/adt-bundle-mac-x86_64-20140321/sdk/tools
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
eval "$(rbenv init -)"

but still Error while i executing cordova platform add android or ionic platform android:

Error: The command "android" failed. Make sure you have the latest Android SDK installed, and the "android" command (inside the tools/ folder) is added to your path.

Any Solutions? thank you

Try to run android in command line. if the command is not found, it's mean that the path of android sdk that registered is still wrong

AndroidDev PATH

export PATH=${PATH}:~/android-sdk-linux/tools

export PATH=${PATH}:~/android-sdk-linux/platform-tools

You have to manually reload your setting like for Ubuntu I am using this command "$ source ~/.bashrc"

Thank you All for your clue of solutions. I try add $HOME because /Development directory in /Home directory and i followed code RVM in my .bash_profile:

`[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
eval "$(rbenv init -)"`

The solutions in How to add android to cordova platform? PATH error? i followed symbol ~ for initialize /Development directory in /Home directory, but it's not working. and I try follow code RVM in my .bash_profile use $HOME .

this is my .bash_profile:

 export PATH=${PATH}:$HOME/Development/adt-bundle-mac-x86_64-20140321/sdk/platform-tools:$HOME/Development/adt-bundle-mac-x86_64-20140321/sdk/tools
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
eval "$(rbenv init -)"

and then run command source ~/.bash_profile . Solved

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM