Click here to Skip to main content
15,885,366 members
Articles / Mobile Apps / Ionic
Tip/Trick

Getting Started With Ionic 4 Cross Platform Android and IOS App

Rate me:
Please Sign up or sign in to vote.
5.00/5 (5 votes)
15 Nov 2018CPOL1 min read 6K   2  
Starting with Ionic Framework

Let's Start

Use Window cmd/mac terminal OR Visual Studio code terminal.

Node Installation

Step 1: First update npm:

  • npm install -g npm stable

Step 2: Then update node:

  • npm install -g node OR npm install -g n

Step 3: After this, check version of node:

  • node --version OR node -v

Create Your First Ionic Project

Step 1: With Node and NPM setup, let’s install the Ionic and Cordova CLI.

  • npm install -g cordova ionic

Step 2: Once that’s done, create your first Ionic app:

  • ionic start helloWorld blank

Step 3: To run your app, cd into the directory that was created and then run the ionic serve command to test your app right in the browser!

  • cd directory | For Example: >cd c:\User\Ionic\helloWorld

Step 4: Recompile:

  • npm install --rebuild
  • npm install node-sass --rebuild
  • npm install @ionic/app-scripts@latest --save

Step 5: Run your app:

  • ionic serve

Generate Pipes, Components, Pages, Directives, Providers, and Tabs Command

  • ionic generate
  • ionic generate component
  • ionic generate directive
  • ionic generate page
  • ionic generate pipe
  • ionic generate provider
  • ionic generate tabs
  • ionic generate component foo
  • ionic generate page Login
  • ionic generate page Detail --no-module
  • ionic generate page About --constants
  • ionic generate pipe MyFilterPipe

Add the Platform and Build

For Ionic Android

Step 1: Add Android Platform

  • ionic cordova platform add android

Step 2: Build android(.apk)

  • ionic cordova run android --prod --release

OR:

  • ionic cordova build android --prod --release

For Ionic iOS

Step 1: Add ios Platform

  • ionic cordova platform add ios

Step 2: Build ios(.ipa)(apple mac required)

  • ionic cordova run ios --prod --release

OR:

  • ionic cordova build ios --prod --release

That's it - you're done!

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
Pakistan Pakistan
.NET Developer | Asp.NET Core | Angular 5/6/7 | Ionic Framework

I pride myself on learning new technologies and continually improving my skill-set. As a Software Developer, I believe in professionalism, communication, clean code and representing my craft to the highest degree possible.

Comments and Discussions

 
-- There are no messages in this forum --