For anyone running cordova-android 6.2.1, you will find that
ionic emulate android may fail with
Error: android: Command failed with exit code 2.
This is apparently due to the fact that Android SDK 26+ has deprecated the
android command. More info and a workaround over at http://stackoverflow.com/questions/43354800/cordova-error-running-on-android-emulator-android-command-failed-with-exit-co
Took me a good hour to get through this, so hope this helps!