Related
I know that so many people have asked this question earlier. But I think my situation is different. In my case Xcode 9.2 was already installed and I upgraded macOS from 10.13.2 to 10.13.5. Then I installed Xcode 10 beta. Now when I'm running any project on Xcode 9.2 and try to use simulator, its becoming black though I can see the xcode logs. Things I have tried so far,
Uninstalled Xcode 10 Beta
Uninstalling & reinstalling Xcode 9.2
Uninstall Xcode 9.2 and install Xcode 9.4
Reset Content & Settings from simulator menu
Restart Device from simulator menu
Resizing simulator.
Followed this post and cleaned DerivedData, CoreSimulator, iOSDeviceSupport
Re add simulators from devices & simulators section
Now what should I do now?
Try running defaults write com.apple.CoreSimulator.IndigoFramebufferServices FramebufferRendererHint 3 in Terminal (source). Note that this will force Simulator to use OpenGL instead of Metal, so you'll want to re-run it with 0 once this gets fixed.
try workaround, delete Library/Developer folder and start it again
Another option that occurred for me. I subclassed UIWindow and called .init(frame: .zero). Changing to .init(frame: UIScreen.main.bounds) fixed it.
Open up XCode 9 and go to add additional simulators(pictured below) re-add iOS 10 and iOS 11 simulators
You seem to have tried everything except changing the iOS simulator version you are trying to run.
Maybe the problem lies with that specific version of iOS simulator eg. iOS 11.x iPhone 6. Change that and it may run OK.
If you do not have desired version with you, go to XCode->Preferences->Components, and download one of the older iOS simulators available at the time of XCode 9.x.
Then, go to XCode->Windows->Devices and Simulators. Press + sign at the bottom left of the screen. Add your desired simulator version (give your desired name), so that this newer simulator appears in runnable scheme list of XCode.
This is just for the users that failed trying everything to save Xcode 10 and then reinstalled Xcode 9.4.1 and the simulator still not working.
Here is what I did to give Xcode 9.4.1 back running.
After I got this problem after upgraded to Xcode 10.
I tried that famous FramebufferRendererHint, didn't work for me.
I have found out the Xcode 10.1 beta release didn't fix the problem for someone else, so I didn't bother to try 10.1 beta.
From the online research I know the problem is in /Library/Developer/PrivateFrameworks/CoreSimulator.framework.
Without Xcode even installed on your Mac /Library/Developer doesn't exist.
So it is installed by Xcode when your first time run Xcode. You would notice a screen showing "Installing Components"
But after you installed Xcode 10 and then install/run Xcode 9.4.1 it won't touch that folder anymore. So problem stays even you put Xcode 9.4.1 back
That's why after I downloaded Xcode 9.4.1 expanded and ran it. Problem still there.
I didn't backup my Mac. So I decided to start from scratch. Restored my MacBook from Internet, downloaded Xcode 9.4.1 again. and now everything is back to normal.
I can keep releasing the App to App Store now.
In my case (xcode 10), I just left the computer for 10 minutes or so (out of frustration!) and when I came back I found it at the starting screen! .... I guess for the first time it takes time
I have Xcode 6.1.1 and I want to run my app in deployment target : iOS 7.0 , so I tried to download the iOS 7.1 Simulator, but the progress bar is still white (no progress)
How do I fix this problem? and is there an another way to download this simulator? When I put deployment target : ios 7.0 the default simulator doesn't run , it is run only in deployment target : ios 8.0. Note : I am using Swift if it has any affect and my Mac OS version is : OS X Yosemite 10.10.1
Are you using a laptop? I was having this issue while trying to download anything from Xcode. The actual culprit turned out to be my laptop not being plugged in. Apple products seem to halt all downloads on battery power. For some reason Xcode doesn't show any message whereas the App Store immediately complains. I plugged in my laptop and it immediately started downloading.
Potential Solution:
I started the download on 6.0.1, had the same kind of problem. The download progress bar never showed any progress, but I noticed in system activity that data was coming in. I waited until I could see over 900 Mbytes was received (the download is only 850 or so).
I double clicked the entry (near the progress bar) and got a message that an error had occurred - try again later. I closed and re-opened XCode, and the install HAD completed.
6.1.1 on Mavericks did the same thing, but 6.1.1 on Yosemite worked as expected.
I was able to resolve this by reinstalling Xcode 6.1.1. I trashed the existing app in /Applications and redownloaded it from the App Store. I then went to reinstall the 7.1 simulator and it worked (though it was slow).
I should also say that the iOS 7.0 Simulator is not available on Yosemite. Only 7.1 and 8.1.
More than 1 Xcode?
I was able to replicate this by having both an Xcode and Xcode-beta installed concurrently.
Downloading legacy simulator did not work on Xcode, but did succeed on the Xcode-beta. Restarting (or rebooting) Xcode surprisingly worked, and the legacy simulator is available from both Xcode versions.
Had the same issue, progress did not move but data was .
To see progress I contracted and then expanded "components" tab. And after expanding I saw real progress
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)
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.
the trick is, to select the right command line tools!
just select it here
reboot(!) and everything is fine again :-)
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.
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.
In my case, i reset ios simulator settings fix it.
iOS Simulator -> Reset Content and Settings ...
Open Xcode 6 beta
Goto Window > Devices
Click on the little + sign at the bottom
Add (if missing) all the devices that you want, or delete and recreate if not working.
If anyone of the simulator is not working then you can delete it and then re-create it again in this menu.
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.
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.
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.
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.
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
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:
Open terminal and typing "sudo vi /etc/launchd.conf"
Changing
"setenv DYLD_INSERT_LIBRARIES /usr/lib/libimckit.dylib"
to
"unsetenv DYLD_INSERT_LIBRARIES /usr/lib/libimckit.dylib"
Save changes
Reboot your system
In this post [1] explain what DYLD_INSERT_LIBRARIES is for
[1] https://stackoverflow.com/a/26053165/2091181
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.
Remove XCode6Beta from Applications.
Restart Machine (Just in case, this seems to solve some peoples issue completely)
Install XCode6Beta.
Verify the Install Additional Components ran.
Launch Xcode6Beta.
Preferences->General->Change Command Line Tools to Xcode 6.0.
Restart Xcode.
Preferences->Downloads->Download iOS 7 Simulator (If not already downloaded).
Run App on iOS 7 Simulator (Or launch iOS Simulator and switch to iOS 7 device)
If the iOS 7 Simulator is working, Hardware->Devices->Select an iOS 8 simulator.
Delete and recreate any non working iOS 8 Simulators in Window->Devices from Xcode.
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.
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
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.
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.
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)
Force Quit All the apps including xcode and simulator
Restart MAC
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.
Reboot your mac os. its working correctly on xcode 11.3.x and mac os 10.14.6.
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)
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.
the trick is, to select the right command line tools!
just select it here
reboot(!) and everything is fine again :-)
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.
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.
In my case, i reset ios simulator settings fix it.
iOS Simulator -> Reset Content and Settings ...
Open Xcode 6 beta
Goto Window > Devices
Click on the little + sign at the bottom
Add (if missing) all the devices that you want, or delete and recreate if not working.
If anyone of the simulator is not working then you can delete it and then re-create it again in this menu.
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.
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.
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.
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.
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
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:
Open terminal and typing "sudo vi /etc/launchd.conf"
Changing
"setenv DYLD_INSERT_LIBRARIES /usr/lib/libimckit.dylib"
to
"unsetenv DYLD_INSERT_LIBRARIES /usr/lib/libimckit.dylib"
Save changes
Reboot your system
In this post [1] explain what DYLD_INSERT_LIBRARIES is for
[1] https://stackoverflow.com/a/26053165/2091181
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.
Remove XCode6Beta from Applications.
Restart Machine (Just in case, this seems to solve some peoples issue completely)
Install XCode6Beta.
Verify the Install Additional Components ran.
Launch Xcode6Beta.
Preferences->General->Change Command Line Tools to Xcode 6.0.
Restart Xcode.
Preferences->Downloads->Download iOS 7 Simulator (If not already downloaded).
Run App on iOS 7 Simulator (Or launch iOS Simulator and switch to iOS 7 device)
If the iOS 7 Simulator is working, Hardware->Devices->Select an iOS 8 simulator.
Delete and recreate any non working iOS 8 Simulators in Window->Devices from Xcode.
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.
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
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.
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.
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)
Force Quit All the apps including xcode and simulator
Restart MAC
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.
Reboot your mac os. its working correctly on xcode 11.3.x and mac os 10.14.6.
I have an app created from sample code I found online. I hooked up my iPod touch 4G to my computer and everything worked fine, app ran.
Then I hooked up my iPhone 3G to the computer, established provisioning profiles, etc. In the organizer the device shows up as a green dot, so we're good. The name of the device is right there next to the run button so that's a good sign. But when I hit run it says "build succeeded" and then goes directly to "finished running on " but nothing shows up on the app!
I've tried this with several apps now and all work on iPod touch, but none on iPhone.
Devices are running newest operating systems, 4.2 for the iPhone, Xcode version is the newest.
I had a different question with more than likely the same answer
App built with Xcode 4.2 ios 5.0 crashing when installed on iphone with ios 4.3.5
I found the solution here
Is it possible to target older iOS versions when using Xcode 4.2 and iOS 5 SDK?
by mmorris
I had to do what he clearly explained and 1 more thing:
Set the compiler in the Project and Target Build Set to LLVM GCC 4.2
That got the app running on my older devices
I had problem to run on simulator not on device.
Tried above options but didn't work for me.
Finally, Just Resetting Simulator did the trick.
Make sure you are targeting the least iOS version and SDK that you can in the build profiles (targets, summary, Devices, Deployment target). Also, check the error console (All Output) at the bottom right and see if there's some kind of problem occurring.