Refer to the following article to build Ionic + Cordova development Environment--
Ionic+cordova Study Environment Construction
The front is still relatively smooth, but when you start to test engineering Helloword, run sudo ionic platform add Android
Error:android_home is not set and "ANDROID" command isn't in your PATH. You must fulfill at least one of these conditions. At/users/someone/.cordova/lib/npm_cache/cordova-android/3.6.3/package/bin/lib/check_reqs.js:158:19 at _ Fulfilled (/users/someone/.cordova/lib/npm_cache/cordova-android/3.6.3/package/bin/node_modules/q/q.js:798:54)
After adding the path and android_home environment variables in the/etc/profile, the problem remains.
Google, found that some people encounter this strange situation, no one has the means to solve.
Finally, inspired by one of the replies (which mentions to ensure write access to the SDK directory), the ADT SDK directory is placed in the current user's ~ directory, and permissions are modified:
chmod 777 sdk/
Problem solving.
"Android_home is not set and" ANDROID "command isn't in your PATH." The wrong solution