Issues emulating ios


#1

When following the instructions to build and then emulate ios on OSX Yosemite, I get the following error in red text:

** BUILD SUCCEEDED **

2014-09-16 09:58:44.963 ios-sim[1561:25856] stderrPath: /Users/Jstaud/myApp/platforms/ios/cordova/console.log
2014-09-16 09:58:44.963 ios-sim[1561:25856] stdoutPath: /Users/Jstaud/myApp/platforms/ios/cordova/console.log

then this error follows in red text:

Session could not be started: Error Domain=DTiPhoneSimulatorErrorDomain Code=2 “Simulator session timed out.” UserInfo=0x7fa44d010430 {NSLocalizedDescription=Simulator session timed out.}
Error: /Users/Jstaud/myApp/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:135:23)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:743:16)
at Process.ChildProcess._handle.onexit (child_process.js:810:5)

Any help on this issue would be great.

I should mention that I’m using Xcode 6 GM.


#2

Hmm, I’m getting this error during my local testing. I’m thinking this is something that is related to cordova. Seems that cordova is not yet updated with the new version of xcode


#3

At one point I was able to get it to work as long as I opened the built project in xcode then run it from within xcode, but it is fairly buggy and doesn’t always work.


#4

I have a variation of this issue using Mavericks and Xcode 6. It seems as though the latest ios-sim no longer accepts how ionic is trying to launch the emulator? Any thoughts on how to circumvent this?

Note the first 2 lines:

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=0x7fce5af342e0 {NSLocalizedDescription=Simulator session timed out.}
Error: /users/p/web/test/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:135:23)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:756:16)
at Process.ChildProcess._handle.onexit (child_process.js:823:5)


#5

I think mhartington is right. If you look at the file path where the error is, it’s Cordova that is buggy. If we could patch those files it would probably work.


#6

Encountering the same issue described here. I have ios-sim 3.0.0, cordova 3.6.3-0.2.13 and xcode 6.0.1.


#7

I am also facing same issue. I have update everything Xcode, Cordova, npm, ionic. Still can’t solve this. If anyone has solved this, please post solution.


#8

I’d be willing to help test. Same problem.

https://gist.github.com/benallfree/d527d9f2a09e142f8ffa


#9

Can you guys give this a shot?

pkill lldb

There could be some process still running in the background.

If that doesn’t work, please try uninstalling ios-sim and then add it back. I’ve talked to another user that did that and said it solved the problem


#10

That didn’t do it for me, sorry :frowning:


#11

Hmm… have you tried uninstalling ios-sim and the adding it back?

Can you run cordova emulate ios or cordova run ios?


#12

Actually I just tried again and I found the emulator running in under my windows. Apparently when the emulator launches, the window isn’t brought to the front.

So I think my system is working fine, sorry for the confusion. I wasn’t sure what to look for.


#13

Hi, I’ve tried uninstalling, pkill and the cordova commands.
None of them worked for me. I still get this error


Session could not be started: Error Domain=DTiPhoneSimulatorErrorDomain Code=2 “Simulator session timed out.” UserInfo=0x7fd1d8f2a8c0 {NSLocalizedDescription=Simulator session timed out.}
Error: /Users/mlachmis/Developer/shift/client/shiftApp/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:135:23)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:756:16)
at Process.ChildProcess._handle.onexit (child_process.js:823:5)


#14

I’ve gotten the error as well, but I believe that is on the ios-sim side of things. Seems that the simulator is taking a bit longer to boot up, and ios-sim has a timeout set if it can’t connect.

Until that is fixed, a quick solution is to start the simulator a head of time


#15

I also get this error. I’m trying the Getting Started for the first time so this is a bit disconcerting! None of the proposed solutions (including opening simulator first) work for me. :frowning:

** BUILD SUCCEEDED **

2014-10-10 07:24:08.552 ios-sim[43460:507] stderrPath: /Users/jason/dev/ionic/todo/platforms/ios/cordova/console.log
2014-10-10 07:24:08.554 ios-sim[43460:507] stdoutPath: /Users/jason/dev/ionic/todo/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=0x7f997a60e7c0 {NSLocalizedDescription=Simulator session timed out.}
Error: /Users/jason/dev/ionic/todo/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:135:23)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:756:16)
at Process.ChildProcess._handle.onexit (child_process.js:823:5)


#16

I have the same issue here !

As pointed out by others opening the emulator first and then ionic emulate works!

Also:

Usage of '--family' is deprecated in 3.x. Use --devicetypeid instead.
Usage of '--retina' is deprecated in 3.x. Use --devicetypeid instead.

This isn`t called by ionic cli ?


#17

Nope, this is actually called by cordova.

When you you run ionic emulate ios, you are essentially running cordova emulate ios


#18

So for anyone else having this issue and unable to get it to work even if you have ios simulator open already, make sure you’re not using Tmux. For some reason ios-simulator doesn’t like it if you’re inside a tmux session, which is how I generally do my day to day dev.


#19

I am also experiencing the same issue even when the iOS simulator is already running.

Usage of '--family' is deprecated in 3.x. Use --devicetypeid instead.
Usage of '--retina' is deprecated in 3.x. Use --devicetypeid instead.

#20

Yep, this fixed my problem.