Have you tired of searching the ionic and Cordova (PhoneGap) setup tutorial? We have written step by step instructions for you. This article is common for both Windows & Mac. Please do not skip any single steps.
We have also added checklist on every step & included
Note: You must need a mac if you want to build your app for iOS
Tools Required
- Node JS
- JAVA JDK & JRE
- Android Studio
- XCode (available only for mac)
Step 1: Download & Install nodeJS
Node JS is used as an environment for running ionic & cordova.you can download Node JS (stable) using http://nodejs.org/en/download/
Checklist:
1.1: I have downloaded & Installed Node JS
1.2: I have opened Command prompt & Executed node -v
& npm -v
without any error
Step 2: Installing Cordova
For installing Cordova on your machine, you need to open your command prompt/terminal & execute
npm <span class="hljs-keyword">install</span> -g cordova
Checklist
2.1: I have Installed Cordova & I can run cordova -v
without any error
Step 3: Installing Ionic
If you want to install ionic, you can open your command prompt execute
npm <span class="hljs-keyword">install</span> -g ionic
Checklist
3.1: I have Installed Cordova & I can run ionic --version
without any error
Step 4: Download & Install Java JDK & JRE
JDK & JRE are supporting software/libraries for Android Build. Download JAVA JDK from http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html. Download JRE using http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html
Checklist:
4.1: I have downloaded & Installed both JDK & JRE
4.2: I have re-opened Command prompt & Executed java -version
without any error
4.3: I have re-opened Command prompt & Executed javac -version
without any error
If you faced any issue like, command not found, you must need to do path setup for your java. Please refer below
Reference:
- http://www.javatpoint.com/how-to-set-path-in-java
- http://stackoverflow.com/questions/1672281/environment-variables-for-java-installation
- http://warwick.ac.uk/fac/sci/dcs/people/research/csrcbc/teaching/howto/javapath/
- http://www.youtube.com/watch?v=yrRmLOcB9fg
Please don’t move next step without completing the above checklist
Step 5: Installing Android Studio
Android Studio is used for building & generating apk files for your project. Download Android Studio from http://developer.android.com/studio/index.html
Reference
Checklist:
5.1: I have downloaded Android Studio & Installed Successfully
5.2: I have Opened Android Studio & Created First Project Successfully
5.3: I have created an emulator & run my first project successfully
Path setup for Android
You need to setup a path for your android for building your app from the terminal. The path might vary based on your system. Please refer the reference link
For Windows
C:<span class="hljs-symbol">\A</span>ndroid<span class="hljs-symbol">\a</span>ndroidsdk<span class="hljs-symbol">\s</span>dk<span class="hljs-symbol">\t</span>ools;
C:<span class="hljs-symbol">\A</span>ndroid<span class="hljs-symbol">\a</span>ndroidsdk<span class="hljs-symbol">\s</span>dk<span class="hljs-symbol">\b</span>uild-tools/27.0.3
C:<span class="hljs-symbol">\A</span>ndroid<span class="hljs-symbol">\a</span>ndroidsdk<span class="hljs-symbol">\s</span>dk<span class="hljs-symbol">\p</span>latform-tools
For Mac
<span class="hljs-regexp">/Users/</span>sundaravel<span class="hljs-regexp">/android/</span>sdk/tools
<span class="hljs-regexp">/Users/</span>sundaravel<span class="hljs-regexp">/android/</span>sdk/platform-tools
<span class="hljs-regexp">/Users/</span>sundaravel<span class="hljs-regexp">/android/</span>sdk<span class="hljs-regexp">/build-tools/</span><span class="hljs-number">27.0</span><span class="hljs-number">.3</span>
Reference:
- http://www.youtube.com/watch?v=YVaGbwQephg
- http://www.youtube.com/watch?v=S5wqTSuL3j4
- http://www.youtube.com/watch?v=dKjXPKG0X08
- http://www.automationtestinghub.com/setup-android-environment-variables/
Cheers!! Hope this helps.
If you faced any issue, feel free to comment below.
Useful Links