Reputation: 1324
I am trying to add the iOS platform to my cordova project but I keep coming across the same error. I have followed the instructions here.
When I use cordova platform add ios
it gives me the following error
Shauns-MacBook-Pro:hello shaunbrown$ cordova platform add ios
Creating ios project...
Unknown option: n
Usage: head [-options] <url>...
Cordova can only run in Xcode version 4.6 or greater.
Error: /Users/shaunbrown/.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:753:16)
at Process.ChildProcess._handle.onexit (child_process.js:820:5)
I have tried looking around for the error but I can't find anything.
I am running xCode 5.1.1 so I know it doesn't have anything to do with that. Has anyone else came across this issue, or has a fix for this? I am pulling my hair out trying to fix it and so far I havent got anywhere.
I can provide more information if needed.
Upvotes: 1
Views: 2467
Reputation: 1324
I managed to solve this. I opened my .bash_profile
file and commented out the line that referred to my XAMPP installation.
I then restarted terminal and it worked perfectly.
Upvotes: 1
Reputation: 89232
You might have Xcode 5.x, but your command line tools are probably set up for a previous version.
Type:
xcodebuild -version
In a terminal. If you need to update, read this:
Xcode 4.4 and later install Command Line Tools
Upvotes: 0