1. Preparatory work
- Installing jdk1.6+, setting environment variables
Java_homec:\program files\java\jdk1. 5. 0_07classpath.; %java_home%\libpath%java_home%\bin
- Installing ant, setting environment variables
ant_homed:\apache-ant-1.8.2 pathd:\apache-ant-1.8.2\bin
- Install the Android SDK, set environment variables
Android_homec:\program Files\android\sdkpath%android_home%\tools;%android_home%\platform-tools;% android_home%\build-tools\20.0.0;
- Installing the VS2013 WP8 Simulator
2. Download node.jshttp://nodejs.org/download 32-bit or 64-bit version 3, run the node. js Command Prompt input
c:\> NPM install-g PhoneGap
PhoneGap saved in c:\users\[user name]\APPDATA\ROAMING\NPM4, executed under project directory
$ phonegap Create my-app$ cd my-app$ phonegap run Android$ phonegap Run WP8
PhoneGap will automatically establish My-app folder, different platform items under Platforms folder cached content under c:\users\[username]\.cordova\lib5, Android project Eclipse-> Import Imports Project can Android Studio 1.0: Because Android Studio 1.0 is installed by default Android5.0, the compiler version is 21,gradle current version is 2.2.1, so to make some changes to the relevant files
1) Modify the selection My-app\platforms\android\build.gradle
Line 10th classpath ' com.android.tools.build:gradle:1.0.+"21.1.1" = ' 2.2.1 '
2) Modify My-app\platforms\android\project.properties
Line 13th target=android-21
3) Modify My-app\platforms\android\androidmanifest.xml
Line 13th <USES-SDK android:minsdkversion="ten" android:targetsdkversion=" + " />
4) Modify My-app\platforms\android\cordovalib\build.gradle
Line 28th Classpath ' com.android.tools.build:gradle:1.0.+"21.1.1"
5) Modify My-app\platforms\android\cordovalib\project.properties
Line 13th target=android-21
6) Modify My-app\platforms\android\cordovalib\androidmanifest.xml
Line 22nd <USES-SDK android:minsdkversion="ten" />
7) Import,my-app\platforms\android\build.gradleGradle download path for the c:\users\[user name]\.gradle\wrapper\dists, you can download the download tool to the appropriate directory, and create a new content is empty Gradle-2.2.1-all.zip.ok file 8, if the compilation error , prompt for task ' not found in root project ' Android ', then open ANDROID.IML, click "Sync". 6, WP8 project directly open My-app\platforms\wp8\hello_world.sln execution can also, help documents can be read offline after Https://github.com/apache/cordova-docs download
Windows8 under PhoneGap 4 + Android Studio 1.0 + VS2013 Configuration Guide