
Note: Make sure you have an up-to-date version of Node.js installed on your system. If you don’t have Node.js installed, you can install it from here.
Lets get started,
Steps to install ionic framework(Linux only):
From your command line terminal,
- Run, npm install -g ionic@latest
You can verify your installation with the ionic — version command.
2. Start a new Ionic project using ionic start:
Run, $ ionic start myNewProject
navigate through by running, cd ./myNewProject
3. Integrate Ionic with Cordova to bring native capabilities to your app.
npm install -g cordova
note: For more information you can refer to official link here
Steps to run ionic application:
i. To run in the browser:
ionic serve
ii. To run it in android device:
1. Run ionic cordova platform add android to add platform.
2. Run ionic cordova platform remove android to remove platform.
3. To set android and java environment by,
export ANDROID_HOME=”/home/(username)/Android/Sdk”
export PATH=$PATH:$ANDROID_HOME/platform-tools
export PATH=$PATH:$ANDROID_HOME/tools
export JAVA_HOME=”/home/(username)/android-studio/jre”
Check if the path is set by,
echo $ANDROID_HOME
echo $ JAVA_HOME
If gradle is not installed, run sudo api-get install gradle
4. Run ionic cordova build android (optional) to build application.
5. Run ionic cordova run android –device to install app in android phone.
There you go, your first ionic application is running in your phone.
