Mobile Development with Ionic - A list of useful commands

A handy list of commands for Ionic Framework, Cordova and NPM

Setup

npm install -g cordova

npm install -g ionic

Starting a blank app

ionic start todo blank --type ionic1

Android Commands


ionic cordova platform add android

ionic cordova prepare android

ionic cordova build android

ionic cordova emulate android

ionic cordova run android --device

ionic cordova build --release android #dev release

ionic cordova build android --prod --release #prod release

unsigned APKs are then located in platforms/android/build/outputs/apk

iOS Commands


ionic cordova platform add ios

ionic cordova prepare ios

ionic cordova build ios

Browser Commands


ionic cordova platform add browser

ionic cordova prepare browser

ionic cordova run browser

ionic cordova build browser --prod --release #prod release

Testing


ionic serve

Fixing up weird issues

ionic repair
rm -rf node_modules/ plugins/ platforms/android package-lock.json
npm cache clear --force