IONIC2 Frequently Used Commands

IONIC2 | Frequently Used Commands

abba Ionic2, Mobile App Leave a Comment

IONIC2 Frequently Used Commands

Here is a list of IONIC2 frequently used commands that I have found useful while developing the ionic2 apps.

Command
ionic -v
Usage
ionic -v
Description
Find the current ionic version
Command
ionic info
Usage
ionic info
Description
Returns your current system information as follows:

Your system information:

Cordova CLI: 6.5.0
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
ios-deploy version: 1.9.0
ios-sim version: 5.0.8
OS: OS X El Capitan
Node Version: v6.7.0
Xcode version: Xcode 8.1 Build version 8B62
Command
ionic start myFirstIonic2App –v2
Usage
ionic start myFirstIonic2App –v2
Description
This command will create a new ionic2 app named myFirstIonic2App.
Command
ionic serve -l
Usage
ionic serve -l
Description
This command launches your ionic application within a browser and displays iOS and Android versions side by side.
Command
ionic platform add [ ios | android ]
 
Usage
ionic platform add ios
ionic platform add android
Description
This command allows you to add a specific platform that you are building for.

Command
ionic platform rm [ ios | android ]
 
Usage
ionic platform rm ios
ionic platform rm android
Description
This command allows you to remove a specific platform that you added previously.
Command
ionic plugin list
Usage
ionic plugin list
Description
This command allow you to see a list of all the plugins you have installed in your ionic project.

cordova-plugin-console 1.0.4 "Console"
cordova-plugin-device 1.1.3 "Device"
cordova-plugin-splashscreen 4.0.0 "Splashscreen"
cordova-plugin-statusbar 2.2.0 "StatusBar"
cordova-plugin-whitelist 1.3.0 "Whitelist"
ionic-plugin-keyboard 2.2.1 "Keyboard"
Command
ionic plugin add [ pluginName ]
 
Usage
ionic plugin add cordova-plugin-globalization
ionic plugin add cordova-plugin-google-analytics
Description
This command allows you to add Cordova plugins to your ionic application by providing the appropriate plugin name.
Command
ionic plugin rm [ pluginName ]
 
Usage
ionic plugin rm cordova-plugin-globalization
ionic plugin rm cordova-plugin-google-analytics
Description
This command allows you to remove Cordova plugins from your ionic application that you no longer need.
Command
ionic build [ ios | android ]
 
Usage
ionic build ios
ionic build ios –release
ionic build android
ionic build android –release
Description
This command allows you to build your ionic application for iOS and Android.
Command
ionic emulate [ ios | android ]
 
Usage
ionic emulate ios
ionic emulate android
Description
This command allows you to build and run your ionic application for iOS or Android on the iOS or Android emulators.

Command
ionic run [ ios | android ]
 
Usage
ionic run ios
ionic run android
Description
This command deploys your Ionic app on specified platform devices. If a device is not found it’ll then deploy to an emulator/simulator.
Command
ionic state [ save | clear | reset | restore ]
 
Usage
ionic state save
ionic state clear
ionic state reset
ionic state restore
Description
When you add plugins to your ionic app, the package.json file is not updated automatically. This command saves or restores state of your Ionic Application using the package.json file.
save …………………………… Save the platforms and plugins into package.json
restore ……………………………. Restore the platforms and plugins from package.json
clear ……………………………. Clear the package.json of cordovaPlugins and cordovaPlatforms, as well as clear out the platforms and plugins folders
reset ……………………………. Clear out the platforms and plugins directories, and reinstall plugins and platforms

First To Know Club
REGISTER NOW

BE THE FIRST ALWAYS

Register now to BE THE FIRST to get all updates 

Other articles of interest