1, JDK environment variable configuration path:c:\program files\java\jdk1.7. 0_79\bin2, node. JS uses node. JS's npm:http to install Cordova://nodejs.org/after the download is successfully installed, open cmd, go to D disk, create Cordova workspace: mkdir cordovaspace Test installation Result command: node-v3, Git is used for some plugins that may need to be downloaded using git: http://git-scm.com/4, Ant:http://ant.apache.org/bindownload.cgiAfter downloading, unzip, I unzip here to D:\Delp_Tool\ant-1.8. 2, and then configure the variable ant_home in the environment variable, value: D:\Delp_Tool\ant-1.8.2, append in Path%ant_home%\ Bin; test installation effect command: Ant-v Note: If not installed, the background operation will not find ant;5, Cordova1) Installation command: NPM install-G Cordova2) Test installation result command: Cordova-v If the installation of Cordova and Ionic for a long time did not respond, try the following solutions: I. Using the config Command npm config set registry https://registry.npm.taobao.orgNPM Info underscore (if configured correctly this command will have the string response) Ii. command line to specify Npm–registry https://registry.npm.taobao.org Info UnderscoreIII. Editing~/. NPMRC Add the following content registry= https://registry.npm.taobao.orgIf you encounter npm WARN deprecated [email protected]2.0.10:please Update to minimatch3.0. 2 problem, executable: npm install [email protected]3.0.2 6, ionic npm install-G Ionic6, create an app here to create an app named Firstapp,id Com.cycle.first, placed under the first folder: Create command: Cordova Creation first COM.CYCLE.FIRSTAPP Firstapp-d The creation process needs to download some Cordova libraries, so wait a moment, the above command-D is some of the details of the show creation process. 7, add platform (Note: You must install the platform's SDK before adding a platform)1Install SDK Note: There is a relationship between the Android SDK and the Cordavo version:3.0 Required is ANDROID-17 (Android 4.2.2)3.1 and 3.2 require android-18 (Android 4.3)3.3, 3.4, 3.5 requires android-19 (Android 4.4.2) (also ant1.8+after downloading and installing ADT, it is also necessary to configure the variable android_home in the environment variable, which is worth for all the directories of the SDK, such as my installation D:\androidWorkspace\adt\sdk, that will android_home point to this directory, and append to path.%android_home%\tools;%android_home%\platform-Tools Note: You need to restart CMD after modifying path to take effect. 2Add a platform the next command will need to be executed in the app's secondary directory, into FIRST:CD first add Android: Cordova platform Add Android added other platforms: Cordova platform Add Ioscordo VA platform Add Amazon-Fireoscordova Platform Add Blackberry10cordova Platform add Firefoxos will start to download the relevant library of Android, and so on ... Once created, you can use the following command to see which platforms have been added and supported: Cordova platforms LS If you want to delete a platform, you can: Cordova Platform RM Amazon-Fireoscordova platform Remove Android will be added later./first/platforms directory, add a corresponding platform directory, and delete the platform, will also delete this directory. 8, compile the app Cordova build this command will compile./firstapp/platforms All platforms, if you just want to compile the platform separately, just add the platform name on the build. Cordova build Android looks like the first time the compilation is slow ... The process of compiling will output a bunch of things. Finally, if you see build successful, it's all right. In fact, the build command is an abbreviation for the prepare and compile two commands. The above command is equivalent to: Cordova prepare Androidcordova compile Android9and test the app.1Test on Simulator: Enter the following command: Cordova emulate Android However, the data says Windows Convert command conflict, direct "Cordova emulate Android" will report Error:spawn ENOENT, you need to start the emulator first. 2) on the browser test: Enter the following command: Cordova serve Android then enter HTTP in the browser://localhost:8000 can see the sub-branch situation. Note: You can open multiple cmd to run the same app, but the port will start at 8000 +1;3) device test: Insert USB, enter the following command: Cordova run androidandroid Create installation run: Ionic start myproject CD MyProject Ionic platform add Android I Onic build Android Ionic emulate Android emulator runs on Ionic run Android phone on the reference document: http://www.aichengxu.com/view/44135Https//segmentfault.com/a/1190000002933971encountering a problem: if you encounter a Using ThisVersion of Cordova with older version of Cordova-andr OIDs is being deprecated. Consider upgrading to [email protected]or newer. WORKAROUND: Switch to the project directory, execute Cordova platform Add [email protected]5.0.0If you encounter line14:6980 Illegal instruction Node "Basedir/nodemodules/cordova/bin/cordova" "@ "WORKAROUND: Win7 system update: Service Pack1
Transferred from: http://blog.csdn.net/u012868077/article/details/51588445
160902, Ionic, Angularjs, Cordova build Android development environment