第一: 安装Node.js, 下载地址:Node.js 官网 然后在mac终端执行代码
sudo npminstall-g cordova
用命令行工具创建一个空的Cordova工程。首先跳转到 你希望保存新工程的文件夹(命令是cd 文件夹路径),然后输入命令cordova create 工程名。
当然,我们也可以直接 输入命令cordova create 文件夹路径/工程名,在某个文件夹下直接创建工程。
第三
cordova platform add ios
Last login: Thu Apr6 10:10:47 on ttys000
Mac-mini:~ xlsn0w$ cordova create citypark com.sxzy.citypark CityPark
Creating a new cordova project.
Mac-mini:~ xlsn0w$ cd citypark
Mac-mini:citypark xlsn0w$ cordova platform add ios
Adding ios project...
Creating Cordova project for the iOS platform:
Path: platforms/ios
Package: com.sxzy.citypark
Name: CityPark
iOS project created with cordova-ios@4.3.1
Discovered plugin "cordova-plugin-whitelist" in config.xml. Adding it to the project
Fetching plugin "cordova-plugin-whitelist@1" via npm
Installing "cordova-plugin-whitelist" for ios
Mac-mini:citypark xlsn0w$ cordova plugin add cordova-plugin-console
Fetching plugin "cordova-plugin-console" via npm
Installing "cordova-plugin-console" for ios
Mac-mini:citypark xlsn0w$ cordova plugin add cordova-plugin-camera
Fetching plugin "cordova-plugin-camera" via npm
Installing "cordova-plugin-camera" for ios
Fetching plugin "cordova-plugin-compat" via npm
Installing "cordova-plugin-compat" for ios
Mac-mini:citypark xlsn0w$ cordova plugin add cordova-plugin-device
Fetching plugin "cordova-plugin-device" via npm
Installing "cordova-plugin-device" for ios
Mac-mini:citypark xlsn0w$