I’m new to Ionic as well as Cordova. I’ve used PhoneGap in the past, but mostly PG Build and I never really did any compiling on my local machine.
I followed the steps in the Getting Started guide and ran
ionic emulate ios, but I get this error text:
Aalaaps-iMac:myApp aalaap$ ionic emulate ios Running emulate task... Emulating app on platform ios Generating config.xml from defaults for platform "ios" Preparing ios project Running on emulator for platform "ios" via command "/Users/aalaap/Documents/Ionic/myApp/platforms/ios/cordova/run" --emulator Error: An error occurred while emulating/deploying the ios project. Error: ios-sim was not found. Please download, build and install version 1.7 or greater from https://github.com/phonegap/ios-sim into your path. Or 'npm install -g ios-sim' using node.js: http://nodejs.org/ at ChildProcess.<anonymous> (/usr/local/lib/node_modules/cordova/src/emulate.js:67:22) at ChildProcess.EventEmitter.emit (events.js:98:17) at maybeClose (child_process.js:735:16) at Socket.<anonymous> (child_process.js:948:11) at Socket.EventEmitter.emit (events.js:95:17) at Pipe.close (net.js:466:12) Unable to emulate app on platform ios. Please see console for more info.
It suggests installing
ios-sim, so I did that:
sudo npm install -g ios-sim, but it only resulted in the following error:
npm http GET https://registry.npmjs.org/ios-sim npm http 304 https://registry.npmjs.org/ios-sim > email@example.com preinstall /usr/local/lib/node_modules/ios-sim > rake build xcodebuild -project ios-sim.xcodeproj -configuration Release SYMROOT=build Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo. rake aborted! Command failed with status (69): [xcodebuild -project ios-sim.xcodeproj -con...] /usr/local/lib/node_modules/ios-sim/Rakefile:7:in `block in <top (required)>' Tasks: TOP => build (See full trace by running task with --trace) npm ERR! firstname.lastname@example.org preinstall: `rake build` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the email@example.com preinstall script. npm ERR! This is most likely a problem with the ios-sim package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! rake build npm ERR! You can get their info via: npm ERR! npm owner ls ios-sim npm ERR! There is likely additional logging output above. npm ERR! System Darwin 13.0.0 npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "ios-sim" npm ERR! cwd /Users/aalaap/Documents/Ionic/myApp npm ERR! node -v v0.10.24 npm ERR! npm -v 1.3.21 npm ERR! code ELIFECYCLE npm ERR! npm ERR! Additional logging details can be found in: npm ERR! /Users/aalaap/Documents/Ionic/myApp/npm-debug.log npm ERR! not ok code 0
I noticed that it suggests re-running the command as root via sudo, but that’s exactly what I did. I even tried
sudo npm cache clear and re-ran the ios-sim install command, but the same error shows up.