Windows + Android + Cordova + ionic Environment setup

Source: Internet
Author: User

Transferred from: http://dev.fjuts.com:83/blog/index.php/mobile/232.html

One, ant installation

Apache Ant, a tool for automating software compilation, testing, deployment, and more, is mostly used for software development in Java environments.
: http://ant.apache.org/bindownload.cgi
Extracted and placed in a non-Chinese directory. (My directory: E:\Program files\java\apache-ant-1.9.4)
To configure environment variables:
Variable name: Ant_home value: ANT-placed directory (e.g., E:\Program files\java\apache-ant-1.9.4)

Variable Name: Path value:%ant_home%\bin; (note Use the previous variable name in English; Separated, no reminders are repeated below)

5.dos Command Window Test

Ant-version
Ant-h

Second, Android SDK installation

Android Studio: Baidu Cloud Disk
Android Studio will install the SDK itself, if you need to update other versions of the SDK, please "scientific internet" to solve the problem.
To configure environment variables:
Variable name: Android_sdk_home value: SDK directory (E:\ANDROID\SDK)

Variable Name: Path value:%android_sdk_home%\platform-tools;%android_sdk_home%\tools;

4.DOS Command Window Test

Android-h
ADB version
Android List AVD


Third, NODE. JS Installation

: https://nodejs.org/
According to the PC platform to download the appropriate installation package, directly double-click the installation can be, environment variables will be self-configuring, not manual operation.
DOS Test commands
Npm-v


Iv. git installation (code repository management software)

: http://git-scm.com/download/
To download the installation package for the corresponding PC platform, double-click the installation directly.
DOS Test commands
Git--version


Five, Cordova + ionic installation

DOS command installs, waits patiently, attempts unsuccessfully many times.
NPM install-g Cordova Ionic//Installation

NPM Update cordova/ionic-g//updates, this code does not run if it is used when Cordova has an updated version.

Installation path:
C:\Documents and Settings\rensanning\application Data\npm\node_modules\cordova[ionic]
To create a Cordova project:
Create a project directory under any non-Chinese directory: such as E:\cordova
Press and hold shift+ right mouse button, click "Open Command Window Here"

Cordova Create MyApp Com.yourname.myapp MyApp

MyApp is the directory name; Com.yourname,myapp is the project path; MyApp is the project name
There will be E:\cordova\myqpp at this time.

CD MyApp//Enter into the project directory

To add a platform:
Cordova Platform Add iOS
Cordova Platform Add Android

To remove a platform:
Cordova Platform RM Android

Build Platform:
Cordova Build Android
[Real:]
Cordova Prepare Android
Cordova Compile Android

To view the platform:
Cordova Platfrom List

Add Plugins: (More plugins: http://plugins.cordova.io/)
Cordova Plugin Add Org.apache.cordova.device//Device API
Cordova Plugin Add org.apache.cordova.network-information//Network (event)
Cordova Plugin Add org.apache.cordova.battery-status//battery (event)
Cordova Plugin Add org.apache.cordova.device-motion//Accelerator
Cordova Plugin Add org.apache.cordova.device-orientation//Compass
Cordova Plugin Add org.apache.cordova.geolocation//Positioning
Cordova Plugin Add Org.apache.cordova.camera//Webcam
Cordova Plugin Add org.apache.cordova.media-capture//media file processing
Cordova Plugin Add Org.apache.cordova.media//media file processing
Cordova Plugin Add org.apache.cordova.file//file access
Cordova Plugin Add org.apache.cordova.file-transfer//File transfer
Cordova Plugin Add org.apache.cordova.dialogs//dialog box
Cordova Plugin Add org.apache.cordova.vibration//Vibration
Cordova Plugin Add org.apache.cordova.contacts//Contact
Cordova Plugin Add org.apache.cordova.globalization//globalization
Cordova Plugin Add Org.apache.cordova.splashscreen//splash screen
Cordova Plugin Add Org.apache.cordova.inappbrowser//Open a new browser window
Cordova Plugin Add org.apache.cordova.console//debug Console

View installed:
Cordova Plugin ls

To remove a plugin:
Cordova Plugin RM org.apache.cordova.console

Update Cordova:
NPM update-g Cordova

To update the platform project:
Cordova Platform update Android

Cordova Help:
Cordova Help


To create a ionic project:
Create a blank template
Ionic start MyApp Blank

Create a tabs template
Ionic start MyApp tabs

Create a Sidemenu template
Ionic start MyApp Sidemenu

Other operations can perform the same action as long as the above Cordova is replaced with Ionic.
Browser debugging:
Go to the project root directory to execute
Ionic serve

Appears in the following prompt, choose at what address to display 1, ip;2, localhost; here, at your own discretion, choose.
Multiple addresses available.
Please select which address to use by entering it number from the list below:
1) 192.168.0.103
2) localhost
Std in Before prompt
Address Selection:

When you're finished, you'll automatically open the debug page with your default browser
Attach Cordova's api:http://cordova.apache.org/docs/en/3.0.0/index.html
Plugin: Http://plugins.cordova.io

Windows + Android + Cordova + ionic Environment setup

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.