Original: http://www.itwap.net/ArticleContent.aspx?id=26
Ionic Official Tutorial: Http://learn.ionicframework.com/videos/windows-android/
The following is a reference to the official tutorial.
1. Download the JDK and configure the Java Runtime environment
: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html (Please note select the corresponding version of your computer)
Configuration of the Java environment variable: see: http://jingyan.baidu.com/article/f96699bb8b38e0894e3c1bef.html
2. Download Apache Ant and add its bin directory path into the path
: Http://mirror.tcpdiag.net/apache//ant/binaries/apache-ant-1.9.4-bin.zip
After the download is done, unzip the file to a secure directory, and then add the Bin folder path in the folder to the system path environment variable, as in the C drive Program Files directory, add the following value in Path C:\Program files\ Apache-ant-1.9.4\bin; (Add method and Java configuration path variable is the same, note; separate values for each environment variable)
3. Download the Android SDK and configure the SDK runtime environment.
: http://developer.android.com/sdk/index.html here can only download Android SDK without having to download Android Studio. Download complete and install and then add two values to the system PATH environment variable. is the path to the tools directory in the Android SDK and the path to the Platform-tools, respectively. For example:
C:\Program Files (x86) \android\android-sdk\tools;
C:\Program Files (x86) \android\android-sdk\platform-tools;
Here I found that the Android SDK installation directory does not have "Platform-tools" this folder, so asked the next door of the Android development of the small partner, he said it was ADT, and then sent me his side of the environment of this folder, can be used normally.
In fact, the correct solution should be:
Run the Android.bat file under the Tools directory and then the following screen appears, tick the Android SDK platform-tools and install it.
Note: Here I downloaded the pure version of the SDK before there is no Android system, so the same as platform-tools need to check the required version here and then install. At least one system is required here, otherwise the virtual machine cannot be created. Of course, debugging with a real machine can be independent.
Adding system Variables ( citation )
Set Android_home=c:\\android-sdk-windows
Set Path=%path%;%android_home%\tools;%android_home%\platform-tools
4. Download Nodejs for Windows and install
: https://nodejs.org/download/
Installing the NODEJS environment under Windows is simple and can be installed after downloading the correct version on the Nodejs website.
Note that the file you want to mark is in the red box.
Add the Nodejs installation directory to path (for example, my C:\Program files\nodejs)
5, using the NMP provided in the Nodejs to install Ionic and Cordova
Complete the above steps need to configure the environment to complete the setup, then only need to enter a few simple lines of command in the console to install Ionic and Cordova.
Go to the cmd window and enter the following command
NPM install-g Cordova
Press Enter the system will automatically install Cordova;
After the installation is finished, enter
NPM install-g Ionic
Installing Ionic
#完成以上所有步骤, you can start using ionic to quickly develop Android apps.
(iii) Create an Android project and invoke the virtual machine to run:
1. Create an App
In console input
Ionic start MyApp
The MyApp here is the name of your app.
(Note: This step may take a long time, may not move for half a day, but do not hurry not to CTRL + C, to wait.) )
2. Enter the Created app directory
CD MyApp
3. Choose to configure the Android environment
Ionic Platform Add Android
4. Package Build App
Ionic Build Android
5. Run the app (you need to create a new virtual machine/Connect your phone, create a new method: Open the AvD Manager.exe in the Android SDK installation directory to select New)
Ionic run Android
In this step the system will open the virtual machine to run a simple sample app.
Learn more to access Ionic website: http://ionicframework.com/for further reading.
(go) Install ionic under Windows