-
Install Cordova
sudo npm install Cordova
-
Create a project
Create a demo folder Inside automatically loading basic files and directories
Cordova Create demo Com.test.demo demo
-
Copy the Web project to the Demo/www directory
-
Prepare
$ npm install-g Ios-sim $ npm install-g ios-deploy
Install both plug-ins, parameter-G is a global installation.
-
Add platform
Switch to the demo directory because the demo project already has Cordova Android Environment
Just add the iOS platform.
Cordova Platform add iOS
-
Build
cordova build iOS
-
Run
cordova run iOS
-
remove
cordova Plateform rm iOS
- Note: If you need to set up trust to open the app in ios9+ system: Settings-profile-corresponding AppID select Trust
- simultaneously in, iOS9, You may encounter an issue where data cannot be requested because IOS9: the network that is accessed within the
app must use the HTTPS protocol. Most of our current requests still use the HTTP protocol.
So the simplest way is to fallback the HTTP protocol.
Solution: Add an app Transport Security Settings to the plist file, and add a item:allow Arbitray loads set to Yes at the bottom
Official Document: Http://cordova.apache.org/docs/en/5.1.1/guide/cli/index.html#link-2
Cordova.apache.org/docs
Use Cordova to pack IOS apps and problems with Mac