92

Any guess on "Unable to boot device in current state: Booted" error in Xcode6 beta while running (build+run) project in Simulator. I am just running my existing project in Xcode 6 I found above message. I tried cleaning, deleting of the derived data, even restarting the simulator doesn't work. Finally i restarted my Xcode 6 then it is working. Any simpler way to resolve the error instead of restarting your xcode6.

Screenshot for error

Nick Toumpelis
  • 2,717
  • 22
  • 38
ajay
  • 3,245
  • 4
  • 31
  • 59
  • 2
    I'm going to assume this is a bug in XCode; please file it at bugreporter.apple.com. It is a beta after all; the whole point is to find these bugs now. – nneonneo Jun 10 '14 at 07:20
  • 1
    restarting Xcode + simulator helped on me. that is a bug. you don't need to find simplier solution, because that feature won't be in the final release. – holex Jun 19 '14 at 13:20
  • Hope for the best, I Already filed a bug with apple. – ajay Jun 20 '14 at 04:20
  • @ajay : This should not occur in Xcode 6.1 – Jayprakash Dubey Nov 04 '14 at 09:56
  • It does. Using build 6.1 (6A1052d). Tried it twice, downloading the installer from the dev site twice. – Alex Zavatone Nov 21 '14 at 23:17
  • Embarrassingly, I've also encountered this when I accidentally set a breakpoint in Xcode without realizing it. So, something else to check. – kiminoa Mar 17 '15 at 17:10
  • A related problem occurs with wrong command line tools version selected: https://stackoverflow.com/a/50850536/1148030 – Peter Lamberg Jun 14 '18 at 06:06

20 Answers20

54

In Xcode go to the Xcode menu->Open Developer Tool - IOS Simulators. Choose simulator and then go hardware->device->manage device.

If the troubled device shows in the left column, delete it. Then add the device back from the '+' button. If it wasn't there in the first place, simply add it using the '+' button.

Micah
  • 1,676
  • 16
  • 23
47

From terminal, get the list of devices with:

xcrun simctl list

This will show you your list of devices with "Shutdown" or "Booted". You'll likely see your device is in a "Booted" state. You can shut it down with:

xcrun simctl shutdown <simulator id>

Where <simulator id> is the name of the device in the list. For example:

xcrun simctl shutdown "iPhone 6 Plus"
Fraser
  • 14,036
  • 22
  • 73
  • 118
  • Andrews-MacBook-Pro-5:~ andrew$ xcrun simctl shutdown AC399A8C-6434-4C60-9D26-08F7EE033898 An error was encountered processing the command (domain=com.apple.CoreSimulator.SimError, code=159): Unable to shutdown device in current state: Creating – Andrew Paul Simmons Apr 13 '16 at 13:35
  • This a better solution than having to delete the simulator and re-add it. – Toland Hon Nov 12 '16 at 20:07
  • 2
    Excellent - worked for me with a simulated stuck in `"Booted"` – Craig Otis Nov 19 '16 at 16:17
47

2022 fix

I found solution. Simulator -> Preferences -> Simulator lifetime: When Simulator starts boot the most recently used simulator I unchecked.

Vinnie
  • 481
  • 3
  • 3
19

This will kill any booted/running simulators even if the .app is not shown:

xcrun simctl shutdown all
cbedrosian
  • 460
  • 5
  • 11
10

I encountered similar problem. Got it resolved. Below are steps to fix it.

  1. Open Simulator

  2. Select Hardware -> Device -> Manage Devices... Screenshot for Step 2

  3. This will opens a window containing list of simulator devices Screenshot for Step 3

  4. Delete simulator that prompts error by right click on it. Screenshot for Step 4

  5. Again add simulator by clicking '+' button onto right corner of window

  6. Select Simulator Name, Device Type and iOS Version Screenshot for step 6
Jayprakash Dubey
  • 35,723
  • 18
  • 170
  • 177
8

I solved this issue by this way:

  1. Open Xcode
  2. Goto Xcode menu > Open Developer Tool > iOS Simulators
    • It will run Simulator with error
  3. Goto Hardware > Device > Manage Device
  4. Add needed simulator to your system
Brandon Minnick
  • 13,342
  • 15
  • 65
  • 123
Anton
  • 3,102
  • 2
  • 28
  • 47
8

Restarting the computer solved this for me. I restart very rarely so I would never normally have thought of this!

matt
  • 515,959
  • 87
  • 875
  • 1,141
6

This solution worked for me Go to Xcode -> Open Developer Tool-> Simulator -> uncheck the option when simulator starts boot the most recently used simulator

3

Quit iOS simulator. Change Target iOS Simulator to any other iPhone or iPad and then run app. Its working for me.

Jayprakash Dubey
  • 35,723
  • 18
  • 170
  • 177
Anand
  • 3,346
  • 9
  • 35
  • 54
  • 1
    I have tried same way you mentioned above, before posting the question here..I am wondering how it is working in your case... – ajay Jun 13 '14 at 10:12
3

Delete all devices on Simulator->Hardware, and add them back, not working :(

Bug or not, restarting Xcode doesn't work for me; could not get Simulator back to work until restarting my computer and it seems the adding-back had failed before restarting.

BabyPanda
  • 1,562
  • 12
  • 18
3

Applicable for Xcode 6.x, here is the command-line solution (type on Terminal window):

  1. xcrun simctl shutdown
  2. xcrun simctl erase
  3. open /Contents/Developer/Applications/iOS\ Simulator.app

Where is the id of the device you want to launch. You can get the list of devices and their UDIDs here:

  • xcrun simctl list
3

I had the same problem. I reset the settings on the iOS Simulator, and run an xcrun simctl erase all and got the simulator working again.

2

Quit Xcode and Simulator.Then rebuild build and run.

Jayprakash Dubey
  • 35,723
  • 18
  • 170
  • 177
Vineesh TP
  • 7,755
  • 12
  • 66
  • 130
2

Happened to me also, run an xcrun simctl shutdown <simulator uid> and got the simulator working again.

Cristik
  • 30,989
  • 25
  • 91
  • 127
1

I don't know if this is any help to you guys but in my case I had this issue when I had a simulator window already open and I tried the command line invocation of simulator to run a .app file.

/Applications/Xcode.app/Contents/Developer/Applications/iOS\ Simulator.app/Contents/MacOS/iOS\ Simulator -SimulateApplication ${pathToMyApp}/MyApp.app/MyApp

I just quit all of my simulator windows and ran the command again. That fixed it.

0

I had the same problem. I reset the settings on the iOS Simulator, and it was fine again.

iOS Simulator -> Reset Content and Settings...

0

When I came to this issue,I tried to tackle it as follows:

  1. cd /Applications/Xcode.app/Contents/Developer/Applications

  2. In Terminal: open -n Simulator.app.Click Ok. enter image description here

  3. Then go to Simulator->hardware->Device choose another device,not the same type of already opened one.(e.g, the first one is iphone 6 the new one could be iphone 7) enter image description here

4.Then there will open a new simulator.

Hope this will help you.

pigfly
  • 3,348
  • 2
  • 13
  • 11
0

I just quit the Xcode and then remove all derrived data. Then relaunch Xcode and do cleaning, build it wait for it's indexing complete then run the project and issue get resolved.

Chandni
  • 692
  • 1
  • 10
  • 25
0

With simulator opened, select "simulator preferences" and disable (simulator lifetime),so it doesn't use the same simulator used before the default. Resolved for me.

0

just type single command into terminal given follow ==>

xcrun simctl shutdown all

hopefully, it will work.

sherkhan
  • 811
  • 8
  • 8