iOS development environment configuration and Cordova installation and common commands

Source: Internet
Author: User

I. IOS development environment configuration

1, first to have a Mac book, if there is a Mac book, skip steps 2, 3, 4, if not, perform steps 2, 3, 4;

2, download and install VMware Workstation, preferably under the latest version;

3, download and install Unlock-all (VMware workstation default limit install Mac virtual machine, need to install this file to release the limit);

4. Download the image file for Mac OS OS (need to be. ios file) If you are downloading a. dmg file, you need to convert it to an. ios file using the Anytoiso.exe tool and install it in VMware Workstation after the download is complete;

5, install Xcode;

6. Install the. p12 file;

7, the application bundle ID;

8, set up the developer account in Xcode;

9. Download the description file corresponding to bundle ID in Xcode;

Second, Cordova installation and common commands

1.1 Installing Nodejs

Download and install from Nodejs website, after successful installation, enter command at command line: node or NPM, no error can be made.

1.2 Installing Cordova

> NPM install-g Cordova

2. Create a project

A. Create a new folder as the working directory, cmd switch to this path

>CD D:\workspace\cordova

B. Creating Cordova Project

>cordova Create Hellocordova Com.hzjava.myCordova Hellocordova

C. Add platform Support

First, go to the project root you just created.

>CD Hellocordova

And then

> Cordova Platforms Add iOS

> Cordova Platforms Add Android

> Cordova Platforms LS

D. Add plug-ins (add plug-ins according to specific functions, such as scan code plugin, file operation plug-in, etc., you can go to Cordova Plugin library to search for plugins)

> Cordova Plugin Add com.phonegap.plugins.barcodescanner

> Cordova Plugin Add org.apache.cordova.file-transfer

> Cordova Plugin ls

Note: Not all plugins are supported by the platform, some may only support Android, some may support both Android and iOS, so you need to choose plugins carefully when developing multiplatform apps

3. Project Integration 3.1.Android

A. Copy the static HTML file to the Hellocordova\www directory

B. Compiling Android Project:

>cordova Build Android

C. Run eclipse, import the Android project under the Hellocordova\platforms\android path

D. Reference the JS Library of Cordova in HTML:

<script type= "Text/javascript" src= "Cordova.js" ></script>

<script type= "Text/javascript" src= "Cordova_plugins.js" ></script>

3.2.ios

A. Copy the static HTML file to the Hellocordova\www directory

B. Compiling iOS project:

>cordova build iOS

C. Run Xcode and import the Xcode project under the Hellocordova\platforms\ios path

D. Reference the JS Library of Cordova in HTML:

<script type= "Text/javascript" src= "Cordova.js" ></script>

<script type= "Text/javascript" src= "Cordova_plugins.js" ></script>

    • Cordova compilation will copy the [root directory/www] file to the specific platform www folder, if your code is written in the platforms Android, the compilation will be overwritten
    • Because the Add plugin has automatically added the relevant configuration, so as long as there is cordova_plugin.js there is no need to manually reference the Cordova plugin JS.
4. Packaging 4.1.Android

When you import a project under Platforms\android, two Project:hellocordova and Hellocordova-cordovalib appear. When packaging, copy the Hellocordova-cordovalib/bin/hellocordova-cordovalib.jar to the Hellocordova/libs folder, then right-click the main project, select Export,

Choose Export Android Application

KeyStore can create a new one yourself, or you can use an existing

Click "Finish" to successfully export APK

4.2.ios

To package an iOS installation package (IPA) that can be installed on any device, you first need an Enterprise Developer account ($299/year) to confirm that you are satisfied to perform the following steps later:

A. Login to the Apple Developer Center

B.identifiers >> app IDs, click "+", create an app ID, fill in the relevant information next

c.provisioning Profiles >> Distribution, click on the "+" number to create a profile

Select in house

Select an app ID and select the one you just created

Select a certificate

Fill in the profile name

d. Download the created profile

E. Download the certificate file selected in step c

F. Double-click the certificate and profile files in your Mac to import them

G. Open Xcode, select Project, Build Settings >> Code signing,code Signing Identity Select the registered company name

H.provisioning Profile Select the profile you just imported

I.xcode >> window >> organizer >> Archives, click Distribute

J. Select Save for Enterprise or ad hoc deployment, next

K. Select a profile to sign, and then export

If the. IPA file is installed on a third-party platform (e.g. dandelion), the options for exporting are as follows:

iOS development environment configuration and Cordova installation and common commands

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.