Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialGeorge Hamilton
2,777 PointsMy Simulator is just showing black
When I try to run the simulator with my code it says it complies in xcode but the simulator just shows black. When I hit the stop button in xcode I get the error message : "An error was encountered while running (Domain = DTiPhoneSimulatorErrorDomain, Code = 2)" please help
4 Answers
George Hamilton
2,777 PointsI FOUND THE SOLUTION steps 1-2 were just to download all the simulators in the preferences tab of xcode, here is what did the trick even though I have no idea why
3) I am facing same issue again next morning.
Unsetting the DYLD_INSERT_LIBRARIES variable solves my problem:-
a) Open terminal and type "sudo vi /etc/launchd.conf" command and press Enter b) Press I "Insert" mode and change this
"setenv DYLD_INSERT_LIBRARIES /usr/lib/libimckit.dylib"
to this
"unsetenv DYLD_INSERT_LIBRARIES /usr/lib/libimckit.dylib"
and press esc to exit from insert mode.
c) Save changes by typing ":wq" Press Enter
d) Reboot your system and problem soloved.
Goran Jakovljevic
920 PointsActually if your system is a bit slow, this is normal, just wait a minute. On my side i have to wait between 30sec to 1min in order for screen to turn from black to my screen.
Luke Glazebrook
13,564 PointsHi George!
I was facing the same problem when I first started on the iOS course. The first thing I would recommend doing is opening it up and in the top bar under 'iOS Simulator' hit the reset content and settings button.
Once you have done that, if you haven't already since installing xCode, restart your computer.
If you are still having problems after carrying out these steps then reply back to me and I shall try and help you out further.
-Luke
George Hamilton
2,777 PointsHi Luke,
Thanks! I tried both of these things and neither worked; I also tried turning off my firewall. Next, I tried removing and re-adding all of the devices within simulator, but that didn't work either. Please let me know if you have any other ideas.
Thanks, George
Marshall Huss
3,504 PointsDo you have any breakpoints in your code? Try making a brand new project and running it. If that works then the issue is probably in your project.
George Hamilton
2,777 PointsMarshall,
Thanks for the suggestion. I tried creating a new project and unfortunately I'm still getting the same error message and it still says "unable to boot simulator". Please let me know if you have any other ideas.
Thanks, George
Marshall Huss
3,504 PointsIn this case I would delete Xcode from your system, reboot, and reinstall it.
George Hamilton
2,777 PointsMarshall,
Unfortunately I tried this too and it didn't work either; I even tried using this thing called AppCleaner to get rid of all the related files. I think I'm just going to go to the apple store and see if they can help. Thanks anyways
-George
George Hamilton
2,777 PointsMarshall,
Unfortunately I tried this too and it didn't work either; I even tried using this thing called AppCleaner to get rid of all the related files. I think I'm just going to go to the apple store and see if they can help. Thanks anyways
-George
Marshall Huss
3,504 PointsMarshall Huss
3,504 Points