Ionic Framework is useful for building mobile apps like Android and iOS Applications. In this article, you’ll learn how to install ionic framework on Ubuntu 19.04.
First install NPM and node.js in your system using the following commands
$ sudo apt-get install python-software-properties $ curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - $ sudo apt-get install nodejs
Install Ionic and Cordova
Now install cordova and ionic in your system using following NPM command. It will install all other required node modules on your system.
$ sudo npm i -g cordova ionic
After completing the installation of the Ionic framework, use the following command to check the installed ionic version.
$ ionic -v /* _ _ (_) ___ _ __ (_) ___ | |/ _ \| '_ \| |/ __| | | (_) | | | | | (__ |_|\___/|_| |_|_|\___| CLI 4.12.0 */
Create Application with Ionic
Now, You need to create a new Ionic project on your computer using the following command.
$ ionic start myFirstAPP blank
Now use one of the following commands to enable iOS or Android platform. iOS platform will work on MacOS only.
$ ionic cordova platform add android $ ionic cordova platform add ios
Test your App on Browser
For running your ionic app on web browser using the following command.
$ ionic serve
The application runs automatically on your web browser: http://localhost:8100/
Test your App on Real Device
For running your app on a real device you need to setup the following
After installation connects your device by USB. Then on your CLI try typing
$ adb devices /* List of devices attached 0123456789ABCDEF device */
if a device is listed, run
$ ionic cordova run android
If nothing appears on adb devices, go to settings on your phone, developer settings, and activate developer mode and USB debugging. You may need to re-plug your device after activating those settings.