Invalid Device State - Xcode/iOS Simulator error

IosXcodeIos SimulatorApple WatchXcode 6.2

Ios Problem Overview


Problem: I cannot simulate an Apple watch interface. Whenever I try and test my Apple watch app on the iPhone 6 simulator, Xcode successfully finishes and builds the app, attempts at opening simulator and fails with an error message which reads 'Invalid Device State'.

Screenshot added

I believe simulator has a watch simulator that opens along with the compatible iPhone simulator models that can communicate with Apple watch (example: iPhone 6) Although I have yet to see it work. I have built a universal interface for iPad and iPhone and another for the watch, so it's not a matter of the app being for the wrong device. Whenever I test on my actual iPhone I can test the universal interface successfully.

I'm using Xcode 6.2 on iMac OS X 10.10.3

I have tried restarting Xcode/Computer. I can't seem to find any other mention of 'Invalid Device State' anywhere, hopefully due to it being an obvious thing to avoid/fix that I've overlooked. Any help would be appreciated.

Ios Solutions


Solution 1 - Ios

Force Quit xCode and restart will resolve problem.

Solution 2 - Ios

I had come across this issue after updating Xcode 6.4 to 7.1. Below are fixes for this :

  1. Clean project (cmd+shift+k) as well as clean build folder (cmd+shift+k+option)

Screenshot for clean

  1. Quit simulator and run again
  2. Quit Xcode and Simulator and run again
  3. Restart your Mac.

Solution 3 worked for me!

Solution 3 - Ios

I had the same issue. Generally it is because you just update Xcode or change its name in the Applications folder.

If you just restart your computer it will work correctly.

Hope it helps !

Solution 4 - Ios

I observed this happening when more than one Xcode app installed.

To fix this,

  1. Launch Xcode and click preference..,
  2. Go to "Location" Tab, Select correct options from "Command Line Tools" dropdown
  3. Quit Xcode and relaunch it.
  4. Run your app.

Solution 5 - Ios

First of all, just clean the project.

  1. Quit your project.
  2. Quit your Xcode.
  3. Restart Xcode.

This happens to me when I have two different Xcode versions running at the same time. Hopefully this helps you.

Solution 6 - Ios

No need to quit, restart or even re-install. Switch to another iOS Simulator device (6s if you were using 6s plus) and voila!

Solution 7 - Ios

Nothing worked for me on XCode 7.3.1.

Had to reinstall it to make the simulator work.

  1. Go to applications folder. Drag drop XCode to Dustbin.
  2. Empty dustbin contents.
  3. Go to App Store and install XCode.
  4. Run XCode. The simulator should work now.

Solution 8 - Ios

I have Xcode 7.3 and Xcode 8.0 Installed.

If a am working with Xcode7.3 and opens Xcode8.0 to get some code from Xcode8.0 project.

When i run my application on Xcode7.3 So it will give me same error.

Solution is simple ForceQuit or Quit all Xcode's and open the required one.

Solution 9 - Ios

In my case, the simulator would show an indefinite black screen whether attempting to run a project, or running the simulator directly (which should bring you to the simulated home screen). This would happen even on a newly created simulated device.

After the existing suggestions failed, the following worked for me:

  • Delete the Simulator
  • Delete XCode
  • Delete the Developer folder
  • Reinstall XCode from the app store. This requires attempting to run XCode again so that Mac OS will realize it's no longer installed.

Solution 10 - Ios

Jus clean the project and restart Xcode. This happens to me when I have two diffent xcode versions running at the same time.

Solution 11 - Ios

Robust fix is Just Quit your xcode and run again, hope so it will help you. This heck work for me.

Solution 12 - Ios

On M1 Mac I've found more than 3 open simulators can cause this error. Quit the simulator app to fix this error.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionKeeperOfKaleView Question on Stackoverflow
Solution 1 - IosChirag VindhaniView Answer on Stackoverflow
Solution 2 - IosJayprakash DubeyView Answer on Stackoverflow
Solution 3 - IosRoaflinSabosView Answer on Stackoverflow
Solution 4 - IosbademiView Answer on Stackoverflow
Solution 5 - IosMandeep SinghView Answer on Stackoverflow
Solution 6 - IosJohn DifoolView Answer on Stackoverflow
Solution 7 - IosSwapnilView Answer on Stackoverflow
Solution 8 - IosDheeraj DView Answer on Stackoverflow
Solution 9 - IosKevin LaityView Answer on Stackoverflow
Solution 10 - Iosserdar aylancView Answer on Stackoverflow
Solution 11 - IosMuhammad ShauketView Answer on Stackoverflow
Solution 12 - IosNormanView Answer on Stackoverflow