IOS 8 Simulator unable to boot

2019-01-08 00:59发布

问题:

When I try to run my app with Xcode 6 Beta 4 on the Simulator iOS 8.0 I always get this error:

Unable to boot the iOS Simulator

Actually I found some similar questions on this site and I tried all the answers and I still couldn't solve it. I had the same error with the Beta 2 version of Xcode 6 so I decided to wait. But now this is not normal anymore. Did anyone find a reason why this is happening and found the solution?

回答1:

I am very happy that finally my issue resolved. Thanks to apple who helped me.

For those who are still looking for solution, here is the one which helped me:

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.

For reference: Xcode 6 simulator, unable to boot error.



回答2:

I found that removing and re-ading the simulator in Xcode 6 fixes the issue.

  1. After opening xcode 6 open iOS simulator
  2. Open hardware manage devices
  3. Remove all the simulators and readied them



回答3:

Steps that I had to take to get this working.

  1. Remove all versions of Xcode (I had 5 and 6 both in my Applications folder)

  2. Install Xcode 6

  3. Open Xcode and go to Xcode > Preferences > Locations

  4. At the bottom of that screen under Command Line Tools, select Xcode 6.0 and make sure that the path under the select box reads /Applications/Xcode.app

  5. Close that window and go to Xcode > Open Developer Tool > iOS Simulator

  6. If the simulator has an error message, go to Hardware > Device > Manage Devices

  7. Select each of the devices in the left hand column and delete them (delete key on the keyboard)

  8. Completely quit out of the simulator and Xcode. Shut down and restart your computer (not logout)

  9. Once restarted, open up xCode, open the simulator, go back to manage devices and add back in the ones that you want.

The simulator should now work as expected! Long winded, but that's the only way that I could get it to work.



回答4:

My solution was to select Edit scheme

Then select "Run" and change "Executable" from "Ask on Launch" to my own app.

The simulator menu in Xcode was then repopulated.



回答5:

I did follow most of the advices here without any simulators working. I had to remove a single simulator to get them working again.

prompt> xcrun simctl list
== Device Types ==
iPhone 4s (com.apple.CoreSimulator.SimDeviceType.iPhone-4s)
iPhone 5 (com.apple.CoreSimulator.SimDeviceType.iPhone-5)
iPhone 5s (com.apple.CoreSimulator.SimDeviceType.iPhone-5s)
iPhone 6 Plus (com.apple.CoreSimulator.SimDeviceType.iPhone-6-Plus)
iPhone 6 (com.apple.CoreSimulator.SimDeviceType.iPhone-6)
iPad 2 (com.apple.CoreSimulator.SimDeviceType.iPad-2)
iPad Retina (com.apple.CoreSimulator.SimDeviceType.iPad-Retina)
iPad Air (com.apple.CoreSimulator.SimDeviceType.iPad-Air)
Resizable iPhone (com.apple.CoreSimulator.SimDeviceType.Resizable-iPhone)
Resizable iPad (com.apple.CoreSimulator.SimDeviceType.Resizable-iPad)
== Runtimes ==
iOS 7.0 (7.0 - Unknown) (com.apple.CoreSimulator.SimRuntime.iOS-7-0) (unavailable, runtime path not found)
iOS 7.1 (7.1 - Unknown) (com.apple.CoreSimulator.SimRuntime.iOS-7-1) (unavailable, runtime path not found)
iOS 8.1 (8.1 - 12B411) (com.apple.CoreSimulator.SimRuntime.iOS-8-1)
== Devices ==
-- iOS 7.0 --
-- iOS 7.1 --
-- iOS 8.1 --
    iPhone 4s (5F44F3AD-FE17-4EF6-A8DD-5A10E2EDCA09) (Shutdown)
    iPhone 5 (76053A14-F43C-4A32-8A72-96177C848741) (Creating)
    iPhone 5s (7998167A-E763-42F6-8945-65B514378154) (Shutdown)
    iPhone 6 Plus (4360DA62-2C1E-4529-AA30-F11CC9357854) (Shutdown)
    iPhone 6 (EE992AE3-B08E-4897-B28D-CEA486062E05) (Shutdown)
    iPad 2 (0D28BB5D-DD40-419D-8BA7-E9A1E9C777C6) (Shutdown)
    iPad Retina (365413A3-3F93-4EC4-B2DE-0D65358A81F3) (Shutdown)
    iPad Air (13CCAAF0-268D-47B0-9031-2034BE919BC1) (Shutdown)
    Resizable iPhone (8D5A265E-B714-4298-988C-3365E18391C9) (Shutdown)
    Resizable iPad (0EBB1D3B-951C-4BB1-813B-A0E83E67B0EB) (Shutdown)
prompt>

Solution was to delete the simulator stuck in (Creating) mode

prompt> xcrun simctl delete 76053A14-F43C-4A32-8A72-96177C848741


回答6:

Following are the steps for solved above issue:

  1. Search launchd.conf file in your mac

  2. If not found then create from Terminal with help of command

~ user$ sudo touch /etc/launchd.conf

  1. Terminal will ask you machine password

  2. Then Open created file with help of command for EDIT, if terminal give you error as permission failed

~ user$ sudo /Applications/TextEdit.app/Contents/MacOS/TextEdit /etc/launchd.conf

  1. Open file manually from /etc/launchd.conf (Shift+cmd+g) and enter /etc/ (TextEdit software)

  2. In file "DYLD_INSERT_LIBRARIES" flag replace with "ZZ" and save it.

  3. Restart your machine.

  4. Xcode will defiantly works.



回答7:

Even I encounter same problem, after a bit of toying around with Xcode and iOS simulator I am able to fix this issue with following steps:

  • First I will try to Reset Content and Settings... in OS Simulator.

  • If it doesn't work I will quit iOS Simulator and try.

  • Still if it doesn't work I will quit both Xcode and iOS Simulator.

You should be able to fix things using above steps, if it doesn't, try reboot and then see if you can get things up and running.



回答8:

I just wrestled with this problem for a while and running this line finally fixed it for me in Xcode 6.2, running iOS8.2.

launchctl setenv DYLD_INSERT_LIBRARIES ZZ

It is doing the same thing as the accepted answer, but I could no longer set variables with launchd.conf in Yosemite:

Setting environment variables via launchd.conf no longer works in OS X Yosemite/El Capitan/macOS Sierra?



回答9:

I have both 6.3 and 6.2 for some older swift tutorials, most of the time it is fine but sometimes I get this error when switching and it seems like it is some background issue with the simulator. I just restart my system and it works fine after boot. Kind of the hard way to go around but I dont do this often.



回答10:

I was facing same issue for Xcode 8 and 7.3.1 version. Upgrading mac OX Sierra solved the issue