51

I cannot launch the simulator successfully. Once I launch the IOS Simulator this error appears:

"Unable to boot the IOS Simulator."

Following the IOS Simulator error, I then get an error from Xcode reading:

Unable to run app in Simulator
An error was encountered while running (Domain = DTiPhoneSimulatorErrorDomain, Code = 2)

Screenshot for error

UPDATE:

This might sound silly but I went to Xcode/preference/Downloads with intentions of seeing a IOS 8.0 Simulator but there was none. Could this be the problem? Am I suppose to have a IOS 8.0 Simulator? If so can someone direct me how to get it? Also, under the "Downloads" tab in Xcode preference I do see IOS 7.0 and 7.1 Simulators and both work fine with Xcode 5.

Cœur
  • 37,241
  • 25
  • 195
  • 267
JakeFromStateFarm
  • 547
  • 1
  • 4
  • 8
  • 1
    @Bill I tried rebooting several times and no luck. Any other suggestions? Thanks! – JakeFromStateFarm Jul 13 '14 at 23:00
  • 1
    “This might sound silly but I went to Xcode/preference/Downloads with intentions of seeing a IOS 8.0 Simulator but there was none.” Each release of Xcode includes the simulator for the then-current release of iOS. For Xcode 6, that is the iOS 8.0 simulator. It should already be included with your Xcode 6 installation, so it isn't in the Downloads pane (but see Anton Stremovskiy's answer). – rob mayoff Aug 20 '14 at 22:03
  • This error is most frequently caused by DYLD_INSERT_LIBRARIES being set. See my answer below or any of the multiple dupes you can find by searching for 'DYLD_INSERT_LIBRARIES iOS Simualtor' – Jeremy Huddleston Sequoia Sep 26 '14 at 22:13
  • possible duplicate of [Unable to boot iOS 8 Simulator](http://stackoverflow.com/questions/25987302/unable-to-boot-ios-8-simulator) – Jeremy Huddleston Sequoia Sep 26 '14 at 22:17
  • 1
    Possible duplicate of [Unable to run app in Simulator: Xcode beta 6 iOS 8](https://stackoverflow.com/questions/24033417/unable-to-run-app-in-simulator-xcode-beta-6-ios-8) – Cœur Oct 22 '18 at 05:36

20 Answers20

60

the trick is, to select the right command line tools! just select it here enter image description here

reboot(!) and everything is fine again :-)

Community
  • 1
  • 1
Flori
  • 2,453
  • 1
  • 21
  • 31
19

Ok It's known problem. Do you see simulators list? If not

Goto Xcode Menu -> Open Developer Tool -> It will open a simulator in your Dock -> click on simulator then go to Simulator Menu: Hardware -> Device -> Manage Devices. Add needed simulators. Always try to run your app with different simulators.someone will work.

Anton
  • 3,102
  • 2
  • 28
  • 47
  • 1
    I do see the simulator list and I tried all simulators. I also tried deleting and adding simulators and still no luck. I am completely lost as to why its not working. Any other suggestions @Anton – JakeFromStateFarm Jul 14 '14 at 01:59
  • Just try only completely remove Xcode 6 with all its system files from your mac and Install it again from package. – Anton Jul 14 '14 at 02:20
  • I tried deleting and reinstalling a few times also @Anton – JakeFromStateFarm Jul 14 '14 at 02:22
  • When you are deleting Xcode 6 from Applications only, it not removing your internal files. I am using AppCleaner app to remove it. I don't know if it's still exists. I installed it years ago. If it's still not working, the other suggestion to wait beta 4 Xcode 6. If it's happening on your existing project? Or on new project? – Anton Jul 14 '14 at 02:27
  • You are not alone :) http://stackoverflow.com/questions/24033417/unable-to-run-app-in-simulator-xcode-beta-6-ios-8 – Anton Jul 14 '14 at 02:31
  • I do have AppCleaner installed and I also tried using it. I guess I will just have to wait for beta 4 or the official release. I am just confused as to why its not working for me. I am reading about possible solutions but nothing seems to be working for me. Thanks for your help @Anton – JakeFromStateFarm Jul 14 '14 at 02:39
  • I asked you above, if it's happening on a new project or old one? – Anton Jul 14 '14 at 23:49
  • Oh sorry I didn't get back to you. I tested on both new and old projects and the same error appears. @Anton – JakeFromStateFarm Jul 15 '14 at 00:15
  • Have you checked this link? http://stackoverflow.com/questions/24033417/unable-to-run-app-in-simulator-xcode-beta-6-ios-8 – Anton Jul 15 '14 at 00:36
  • yup, that was the first solution I came across. I am running out of ideas as to why its not working for me. @Anton – JakeFromStateFarm Jul 15 '14 at 00:43
  • I think just wait for other beta. – Anton Jul 15 '14 at 14:18
  • 3
    Yeah, was hoping Beta 5 fixed it, but no. I can only use the iOS 7 simulators. – ZaBlanc Aug 06 '14 at 05:17
  • I did this, and it worked. On the Devices List (inside iOS Simulator) I removed the iPhone 5s, and added a new one. Ran the simulator the app on the simulator again, and it worked. – Sparragus Sep 04 '14 at 18:25
  • This answer really worked for me and it forced me to up-vote the answer. By this, we can add desired number of Devices with the combination of iOS versions. – NSPratik Nov 26 '14 at 05:29
15

Restart your Mac. I just had that exact error after installing Xcode 6 beta 7, literally the only thing I did in response was reboot my Mac and now the iOS 8 simulator is working.

This error is common if you update Xcode without restarting afterwards.

w0mbat
  • 2,430
  • 1
  • 15
  • 16
9

In my case, i reset ios simulator settings fix it.

iOS Simulator -> Reset Content and Settings ...

eason
  • 2,854
  • 3
  • 16
  • 18
  • I'm geting an error while resetting content of simulator. "Unable to boot device in current state: Creating". What the hell is this? – Jayprakash Dubey Oct 21 '14 at 06:34
8
  1. Open Xcode 6 beta
  2. Goto Window > Devices
  3. Click on the little + sign at the bottom
  4. Add (if missing) all the devices that you want, or delete and recreate if not working.
  5. If anyone of the simulator is not working then you can delete it and then re-create it again in this menu.

enter image description here

Umar Farooq
  • 735
  • 1
  • 10
  • 19
  • Are there no simulators when xcode and the sdk are installed? This solution was exactly what I needed, I'm starting the iOS tutorials and creating a simulator isn't in the getting started steps. I think Apple need to update their docs. – CheeseFerret Jan 25 '15 at 21:44
  • yea may be, i dont see exactly when i installed xcode 6 – Umar Farooq Jan 26 '15 at 13:47
  • Struggled a long. Your answer solved my headache. Thanks. – Alex Feb 13 '16 at 05:27
3

I saw the same issue when I installed Xcode 6 beta 6, and deleted beta 4 and beta 5. Apparently, deleting the old betas also deleted the iOS Simulator 8 versions! Putting it back from my Trash solved the issue.

Solution: Don't delete old beta software!

Edit: @Flori's solution worked. Was able to delete the old beta software, and after a complete system reboot, it worked again.

Jon
  • 7,848
  • 1
  • 40
  • 41
3
  • From the xCode 6 pull down menus, Xcode > Open Developer Tool > iOS Simulator (if you get a pop up error just dismiss it)
  • Once in the Simulator go to Hardware > Device > Manage Devices.
  • Delete everything listed under simulator.
  • Reboot your machine.

After that, navigate back to Manage Devices in the simulator and click the plus to add back your simulators. Then the iOS 8 simulators will show up.

pchelnikov
  • 425
  • 6
  • 6
3

Just unset DYLD_INSERT_LIBRARIES environment variable in the /etc/launchd.conf or ~/.launchd.conf file. Which you can edit by sudo vi /etc/launchd.conf command. remove the above flag save it by "ZZ" (captial Z) and reboot the system. It works like a charm.

2

Make sure that path in menu XCode>Preference>Locations point to XCode 6.0 (Restart Xcode after changing them). Then go to menu Window>Devices and add simulator devices you want to use.

jki
  • 4,617
  • 1
  • 34
  • 29
2

I got this issue when moving from Beta 6 to Beta 7. Very frustrating. I could reset content and settings on any of the iOS 8 simulators. None of my iOS 8 simulators were working at all, just a black screen. I restarted my machine during the process, but I am not sure if it did anything. Initially I had only iOS 8 Simulators. I had to remove and reinstall Xcode6Beta7. I did not get the Install More Components the first time I installed it, I am not sure if that was the missing part. I installed the iOS 7 Simulators from Settings->Downloads because my iOS8 ones were not working. After I had reinstalled and relaunched the simulator, I then had a list of iOS 6,7,& 8 simulators. None of the iOS 8 Simulators were working. I was able to launch the iOS7 simulator and then using the device menu change to an iOS 8 Simulator. Some still did not work, I had to remove them and re-add them in the devices screen.

  1. Remove XCode6Beta from Applications.
  2. Restart Machine (Just in case, this seems to solve some peoples issue completely)
  3. Install XCode6Beta.
  4. Verify the Install Additional Components ran.
  5. Launch Xcode6Beta.
  6. Preferences->General->Change Command Line Tools to Xcode 6.0.
  7. Restart Xcode.
  8. Preferences->Downloads->Download iOS 7 Simulator (If not already downloaded).
  9. Run App on iOS 7 Simulator (Or launch iOS Simulator and switch to iOS 7 device)
  10. If the iOS 7 Simulator is working, Hardware->Devices->Select an iOS 8 simulator.
  11. Delete and recreate any non working iOS 8 Simulators in Window->Devices from Xcode.
Patrick
  • 1,629
  • 5
  • 23
  • 44
reshat2
  • 213
  • 1
  • 7
2

Edit: Turns out I was getting my version of the error because I had a file (the "Empty File" type) named "Frameworks" in several of my projects, and this was causing big issues with the iOS 8 simulators. Renaming the file to be anything else, and then doing a Clean Build Folder fixed it right away.

------Deprecated Original Message Below--------

In case this helps anyone -- I was having a similar error on Xcode 6 GM, and tried everything mentioned in these Answers, but the iOS 8 simulators would never run any of my apps (no problems with iOS 7 running from Xcode 6 though).

What did sort of work was creating a new project (new project apps would run in the iOS 8 simulators, but never any luck with existing apps). Copying over files and project settings is no fun, but at least it let me do testing and see if my apps needed fixing for the iOS 8 public release.

Extended description of problem at https://devforums.apple.com/thread/246751

weienw
  • 812
  • 1
  • 8
  • 22
2

I tried everything mentioned above and nothing worked.

Finally the only way to make it work was unsetting DYLD_INSERT_LIBRARIES=/usr/lib/libimckit.dylib

How I did this:

  1. Open terminal and typing "sudo vi /etc/launchd.conf"
  2. Changing

"setenv DYLD_INSERT_LIBRARIES /usr/lib/libimckit.dylib"

to

"unsetenv DYLD_INSERT_LIBRARIES /usr/lib/libimckit.dylib"

  1. Save changes
  2. Reboot your system

In this post [1] explain what DYLD_INSERT_LIBRARIES is for

[1] https://stackoverflow.com/a/26053165/2091181

Community
  • 1
  • 1
Jorge Casariego
  • 21,948
  • 6
  • 90
  • 97
1

I wrestled with this for a bit, with the simulator app reporting that it couldn't find the iOS8 simulator, and suggesting updating in Prefs/Downloads, which didn't work. I tried re-installing Beta 6 twice (without removing all the support files, which would have been next). The initial installation described itself as build 6A280c; a fresh download yielded build 6A280e. No luck.

Eventually, I opened Window -> Devices, and used the "+" button in the lower left to add a new simulator for iPhone 5s, iOS 8, naming it "Fresh 5s". The Schemes popup now displayed three iPhone 5S/iOS 8 options (none with the name I designated, but differentiated by UUIDs); at least one of them worked.

I'm guessing that this feature (collections of arbitrary simulator instances) will be very useful when it's baked. In the meantime, I guess I'll need to manage the list of simulators manually.

Doug Knowles
  • 873
  • 1
  • 8
  • 14
1

Do following steps worked for me:

1. Launch the iOS Simulator and go to iOS Simulator --> Reset Content and Settings...

2. Close all the applications and restart your mac 

3. Open Xcode6.0.1 or 6.0 and test the iOS Simulator
Paresh Navadiya
  • 38,095
  • 11
  • 81
  • 132
0

Had the same problem after moving from Xcode 6 beta 5 to beta 6, but also for the iOS 7.1 simulator. Restarting my machine seemed to do the job. I did not need to update from Xcode 5.1.1 CLT to Xcode 6.0 CLT.

Kyle Clegg
  • 38,547
  • 26
  • 130
  • 141
0

I tried all of the solutions above, and was still unable to launch the iOS8 Simulator. The iOS7 Simulators all launched fine.

Looking at the Console, I found that the launch was crashing, and the crash log complained about the dynamic library, libimckit.dylib. You can read about that here: https://discussions.apple.com/thread/5781366?start=0&tstart=0

The quick solution, remove that and its partner library, reboot, and it loads.

JDA3
  • 356
  • 3
  • 7
0

Is there anything interesting in ~/Library/Logs/CoreSimulator/CoreSimulator.log?

The "Unable to boot the iOS Simulator." error message is almost always because launchd_crashed because DYLD_INSERT_LIBRARIES was set to something not compatible with the iOS Simulator runtime. Do you have any crash logs (eg: launchd_sim crashes) in ~/Library/Logs/DiagnosticReports? If so, check if they show DYLD_INSERT_LIBRARIES being set. If that's the case, your options are to either update to an OS X Yosemite host (which will deal with this issue) or unset DYLD_INSERT_LIBRARIES (likely set in /etc/launchd.conf or ~/.launchd.conf)

Jeremy Huddleston Sequoia
  • 22,938
  • 5
  • 78
  • 86
0
  1. Force Quit All the apps including xcode and simulator
  2. Restart MAC
Saif
  • 2,678
  • 2
  • 22
  • 38
0

Checking in the "Locations" Xcode preference, I had two items of the same version, one located in the app translocation area (/var/.../AppTranslocation/...). Also I had previously done a manual command line tools install. To resolve this in the end I had to delete /Applications/Xcode.app and remove the manual command line tools install:

sudo rm -rf /Library/Developer/CommandLineTools

Then installed Xcode anew, and rebooted. Boom! Simulator working again.

Arru
  • 157
  • 1
  • 5
0

Reboot your mac os. its working correctly on xcode 11.3.x and mac os 10.14.6.

DarkHorse
  • 339
  • 4
  • 16
  • ZhiYi Lee, please don't add _"thanks"_ as answers. They don't actually provide an answer to the question, and can be perceived as noise by its future visitors. Instead, [upvote answers](//stackoverflow.com/help/privileges/vote-up) you like. This way future visitors of the question will see a higher vote count on that answer, and the answerer will also be rewarded with reputation points. See [Why is voting important](//stackoverflow.com/help/why-vote). – 4b0 Apr 23 '20 at 06:49