Invalid Device State iOS-Simulator

Session could not be started: Error Domain=com.apple.CoreSimulator.SimError Code=146 "Invalid device state" UserInfo=0x7f8281769490 {NSLocalizedDescription=Invalid device state}
Error code 1 for command: ios-sim with args: launch,/Users/drakewitt/Desktop/BadKittyApp/platforms/ios/build/emulator/BadKitty.app,--devicetypeid,com.apple.CoreSimulator.SimDeviceType.iPhone-6,--stderr,/Users/drakewitt/Desktop/BadKittyApp/platforms/ios/cordova/console.log,--stdout,/Users/drakewitt/Desktop/BadKittyApp/platforms/ios/cordova/console.log,--exit
Error: /Users/drakewitt/Desktop/BadKittyApp/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:1008:16)
    at Process.ChildProcess._handle.onexit (child_process.js:1080:5)

I get the same error ā€œinvalid device stateā€ when launching from XCode.

Do you have ios-sim installed? npm install ios-sim

I do, I fixed the error by reinstalling Xcode.

1 Like

How do you reinstalled the xcode? I already looked everywhere to find how to uninstall , so i could install again. Did you just installed over the old one?

Deleted the .app in Applications folder.

1 Like

Do you find the ios-sim at this location ?

/Applications/Xcode.app/Contents/Developer/Applications/Simulator.app