Ionic emulate ios throws an error

Hey,

I followed the instructions. First installed ionic, created a project, added ios, built ios. When I tried ionic emulate ios, It is throwing me error.

libc++abi.dylib: terminating with uncaught exception of type NSException

I have X-code installed. It was working fine last month or so. I recently updated x-code on my machine.
Any suggestion on how to get the functionality back?

Thanks

EDIT:
Thanks to @mhartington and @crysfel for pointing out the solution. ios-sim must be updated.
$ npm uninstall ios-sim -g
$ npm install ios-sim -g

Is it just a specific project that throws this error or do you also get this error if you create a new project?

Maybe you can solve it by running: cordova platform update ios

I have the same exact error. It just started occuring.

I also have an issue with xcode not sending any debug-errors (javascript) to the debug output console.

Which I was hoping to get around using emulation.

Maybe the two problems are connected, i dunno.

What version of xcode have you updated to? If it’s xcode 6, you need to update ios-sim to version 3.0. Have you also updated your xcode command line tools?

1 Like

Kinda new but I have the “latest” version of xcode. Unsure how to update the command line tools though. I usually build / prepare using ionic in the cmd and then run xcode after that. I do see stuff in the debugger, but not javascript errors. Which I thought would happen, maybe it’s not so?

So the last error I had were because there were spaces in the path name to my project.

~/Ionic\ Projects/tmp/

Which threw a big error for me.

After remove the spaces it resolved my issue.
~/IonicProjects/tmp/

Note that this is only for cordova 3.6

Im having the same issue here, seems like is a configuration environment issue, I tracked down the error and found out my simulator is not starting, this command is the one throwing the error:

$ ios-sim start

Not sure how to fix this, I will keep looking into this issue. My version is 1.9.0, I will keep you posted if found something else.

Regards

I fixed!!! Just when I submitted my last post I found the solution xD

I went to the ios-sim project on github: https://github.com/phonegap/ios-sim and they said the ios-sim supports xcode 6.x only for version 3.x, my version was really old (1.9.0), you just need to update and that’s it!

$ npm uninstall ios-sim -g
$ npm install ios-sim -g

There you go! The simulator should work now from your Ionic project.

$ ionic emulate ios

Regards

9 Likes

Thanks!
it works now

My problem was that I did not have ios-sim so when installed the problem was gone. What exactly is ios-sim use for?

The iOS Simulator - iPhone 4s was launched [not the ionic hybrid app] but I got this error at the end when I executed “ionic emulate ios”

2014-10-07 20:45:14.222 ios-sim[3860:507] stderrPath: /Users//Mobility//Hybrid-iOS/CLMobile/platforms/ios/cordova/console.log
2014-10-07 20:45:14.223 ios-sim[3860:507] stdoutPath: /Users//Mobility//Hybrid-iOS/CLMobile/platforms/ios/cordova/console.log
Usage of ‘–family’ is deprecated in 3.x. Use --devicetypeid instead.
Usage of ‘–retina’ is deprecated in 3.x. Use --devicetypeid instead.
Session could not be started: Error Domain=DTiPhoneSimulatorErrorDomain Code=2 “Simulator session timed out.” UserInfo=0x7fd44056db60 {NSLocalizedDescription=Simulator session timed out.}
Error: /Users//Mobility//Hybrid-iOS/CLMobile/platforms/ios/cordova/run: Command failed with exit code 1
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:131: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)

Any ideas about this?

Thanks! That worked for me.

Awesome. this fixed it.

Thank you so much!!!

I have exactly the same problem!!!