Skip to content

Instantly share code, notes, and snippets.

@nanusdad
Last active November 16, 2017 13:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nanusdad/ccd6c10eb42c3dfac13f1acceb5e32d8 to your computer and use it in GitHub Desktop.
Save nanusdad/ccd6c10eb42c3dfac13f1acceb5e32d8 to your computer and use it in GitHub Desktop.
Android APK with Ionic and Mac

Using Ionic to build Android APK on Mac

  • Install NodeJS
  • Install ionic and cordova
npm install -g ionic cordova
  • Might need to install node-sass
  • Requires CocoaPods
sudo gem install cocoapods
  • Install node-sass
npm install node-sass
/Users/arun/Library/Android/sdk/tools/bin/sdkmanager
  • Cordova error -

Error: Requirements check failed for JDK 1.8 or greater

https://stackoverflow.com/questions/40628240/cordova-requirements-check-failed-for-jdk-1-8-or-greater

Uninstall JDK 1.9 and try JDK 1.8

To run a different version of Java, either specify the full path, or use the java_home tool:

% /usr/libexec/java_home -v 1.8.0_06 --exec javac -version

Tips

  • License Error

You have not accepted the license agreements of the following SDK components: [Android SDK Build-Tools 24, Android SDK Platform 24]. Before building your project, you need to accept the license agreements and complete the installation of the missing components using the Android Studio SDK Manager. Alternatively, to learn how to transfer the license agreements from one workstation to another, go to http://d.android.com/r/studio-ui/export-licenses.html

  • Fix
yes | sudo sdkmanager --licenses
  • Android debugging (USB)
# list connected devices
adb devices -l

# install APK on file
adb -s HKE6EA35 install ~/Desktop/app.apk 

# view debugging info
adb -d logcat
adb -d logcat '*:E'
adb -d logcat '*:W'
adb -d logcat | grep -i <pattern>
adb -d logcat | grep -i <pattern>
  • Using Chrome to view debug chrome://inspect/#devices
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment