I tried to add ios platform to my phonegap project, but failed. I've already added the android platform successfully. The development environment is Mac. My Xcode version is above 5. I already installed node.js, ant, cordova, phonegap, and so on. This is my first time to ask a question. I already checked other similar questions, but it does not work. Anybody can give some suggestions?
When I run cordova platform add ios
in my project file, here is the console output:
Creating ios project...
Unknown option: n
Usage: head [-options] <url>...
-m <method> use method for the request (default is 'HEAD')
Cordova can only run in Xcode version 4.6 or greater.
Error: /Users/Magnusmode/.cordova/lib/ios/cordova/3.5.0/bin/create: Command failed with exit code 2
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:135:23)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:735:16)
at Process.ChildProcess._handle.onexit (child_process.js:802:5)"
Maybe I added the wrong path of Xcode to ~/.profile. Here is the part of the ~/.profile:
export PATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs:"$PATH"
export PATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk:"$PATH"
export PATH=/Applications/Xcode.app/Contents/Developer/Applications/Xcode.app:"$PATH"
export PATH=/Applications/Xcode.app/Contents/Developer/Applications:"$PATH"
Based on the answer here and the answer here , it sounds like you're on the right track with looking at your PATH
variable.
In particular, if you have XAMPP installed, try commenting out this line from your ~/.profile
like so:
# export /PATH=/Applications/XAMPP/bin:$PATH
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.