Cannot run Ionic apps in my iOS Simulator - Session could not be started error


#1

I have installed Ionic and have successfully got the Android environment working perfect, however I am having issues when trying to emulate my app within the iOS Simulator.

I use the following command to emulate iOS and this opens up the iOS Simulator in iPhone 6 mode

sudo ionic emulate ios

This opens up the simulator and in the terminal does the build and compiling as expected and generates a lot of output in my terminal - after a while I can see my iOS Simulator but nothing else appears (just the Safari icon) and I have the following output in my terminal window.

** BUILD SUCCEEDED **
 
No target specified for emulator. Deploying to iPhone-6 simulator
2015-05-13 14:03:44.009 ios-sim[4219:77085] stderrPath: /Users/school/Documents/mobileapps/nextApp/platforms/ios/cordova/console.log 2015-05-13 14:03:44.010 ios-sim[4219:77085] stdoutPath: /Users/school/Documents/mobileapps/nextApp/platforms/ios/cordova/console.log
Session could not be started: Error Domain=DTiPhoneSimulatorErrorDomain Code=2 "Timed out waiting for device to boot" UserInfo=0x7fc0b2c16d40 {NSLocalizedDescription=Timed out waiting for device to boot} Error code 1 for command: ios-sim with args: launch,/Users/school/Documents/mobileapps/nextApp/platforms/ios/build/emulator/NextApp.app,--devicetypeid,com.apple.CoreSimulator.SimDeviceType.iPhone-6,--stderr,/Users/school/Documents/mobileapps/nextApp/platforms/ios/cordova/console.log,--stdout,/Users/school/Documents/mobileapps/nextApp/platforms/ios/cordova/console.log,--exit Error: /Users/school/Documents/mobileapps/nextApp/platforms/ios/cordova/run: Command failed with exit code 2
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:131:23)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1015:16)
at Process.ChildProcess._handle.onexit (child_process.js:1087:5)

My setup is as follows :

Your system information:

OS: Mac OS X Yosemite
Node Version: v0.12.2
Cordova CLI: 5.0.0
Ionic CLI Version: 1.3.22
Xcode version: Xcode 6.3.2 Build version 6D2102 
ios-sim version: 3.1.1 
ios-deploy version: 1.5.0 

I have setup my Android environment on the same system and this works perfectly fine, I just cannot understand why I can’t get the iOS Simulator to run any apps.

I have tried updating my libraries, using the latest verions of Ionic/Cordova, downgraded to earlier versions, set permissions on folders, run the commands using sudo, removed and re-added platform, run the reset Contents & settings in the simulator, not to mention run the npm cache clean command and I always get the same problem above - Can anyone suggest anything else?


New cordova 5
#2

It may be a memory issue, as mentioned here. For me, turning off MAMP servers solved it.