Unable to Create Device Set at Library/Developer/XCPGDevices - xcode

I'm using Xcode 8 and cannot run a playground. As soon as the playground opens and starts to build the file I get this error:
Under Preferences -> Components in Xcode I do not see any iOS 10 Simulators available for install:
I have Xcode 6.4, 7.3, and 8.0 installed but my command line tools are pointing to Xcode 8. How can I fix this issue?

Restarting my computer and opening Xcode 8 before 7 or 6 fixed this error and made Xcode 8 playgrounds start working again.

Quit all Xcode versions you have running. Quit the simulators as well.
Then open the desired Xcode version.
Go to Xcode >> Preferences >> Locations >> Command Line Tools >> and change it to match the Xcode version you've just selected. You have to do this manually each time you switch between different Xcode versions! To be on the safe side just delete the derived data as well. But I'm usually able to get it to work without that.
If that didn't work then also restart your mac.

Related

When launching an iOS simulator it closes straight away but still runs in the background

When I try to run a project (even a default single view app) in Xcode 10.2 (also occoured on Xcode 10.3 and beta 11 build 3) the simulator launches but then closes but Xcode still thinks it's running (looks like it is running headless). Any ideas on how I can see the simulator?
I have tried the following so far but the only time I can see the Simulator is on its first launch after that it disappears after launching.
Uninstalling and re-installing Xcode (making sure to delete all related directories and doing a system restart)
Adding and removing simulators from window -> Devices and simulators from within Xcode
Tried clearing the simulator cache xcrun simctl erase all
Tried running the following sudo killall -10 com.apple.CoreSimulator.CoreSimulatorService
Clearing Derived data ~/Library/Developer/Xcode/DerivedData/
Another thing I noticed is if I run: /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app/Contents/MacOS/Simulator I get the following error:
Bus error: 10
But if I run: sudo/Applications/Xcode.app/Contents/Developer/Applications/Simulator.app/Contents/MacOS/Simulator the Simulator launches fine.
Thanks for any help.

Xcode error connecting to simulator "Software caused connection abort"

When I try to run my project through the Xcode simulator, it keeps giving me the error "Software caused connection abort".
Tried restarting the simulator & Xcode, and I recently deleted the DerivedData folder as suggested in this post about broken playgrounds so that also didn't help.
QUICK FIX
This is happening because you have multiple versions of Xcode installed. MacOS unfortunately only supports running one version of Xcode at a time, and it needs to know the location of the currently running version. To sort things out, choose one of the following:
Quit all instances of Xcode and restart it
Try one of the other options below if that hasn't solved it.
Using the command line:
run sudo xcode-select --switch /Applications/your_custom_folder_if_needed/Xcode.app
Restart your terminal and Xcode and it will work just fine.
No-command line users:
Quit all instances of Xcode
Start the instance of Xcode that you want to use
Go to Xcode -> Preferences -> Locations
Select the correct version in Command Line Tools
Done!
It's due to multiple Xcode installed in your system. This is how you make it work:
Quit all running Xcodes
Re-launch Xcode
Go to Xcode > Preferences > Locations
Change to the correct version in Command Line Tools
Clean project and clear Derived data if necessary, then run!
In my case quitting and re-launching given Xcode was enough. I had two Xcodes, stable and beta.
For me, restarting the Mac OS worked (multiple times).

Xcode 6.3 is not opening instruments anymore

I updated my Xcode from 6.2 to 6.3 and now instruments is not working anymore, it is requesting a template and it doesn't matter which one is chosen, it is not able to open it.
It is happening with iOS 8.2 on an iPhone 6+, and with the simulator (ios 8.2 and 8.3).
UPDATE I also updated my phone to iOS 8.3 and tried with Xcode 6.4Beta and I still have the same problem.
Try to run this from a terminal:
sudo chmod a+rwxt /Library/Caches/com.apple.dt.instruments
to fixup permissions on that directory.
Source : https://forums.developer.apple.com/thread/6441
I actually got the same problem with Xcode 7 and solved it by deleting instrument's default base temp directory, and I guess it was in this folder (/Library/Caches/com.apple.dt.instruments)

iOS Simulator 6.x does not start on xCode5 installed side-by-side with xCode6 on 10.9+

I finally upgraded to Yosemite but also had this issue on Mavericks.
I downloaded xCode5.1.1 and installed moving to Applications folder and selecting "Keep both", so it renamed the Xcode.app folder to Xcode 2.app. I renamed it to Xcode5.app then.
Now starting the xCode5 and installing all the 6.x SDKs iam unable to start the simulator. It stays black screen.
When i run the iPhone Simulaotr manually from console i get lots of "Service cannot load in requested session" messages.
It tried to load *.plist files from within the /Application Support/iPhone Simulator/6.1/tmp/LaunchDeamons/com.apple.....plist, but that tmp folder is empty.
In xCode5.1.1 on preferences -> Locations i set the command line tools to xCode5.1.1.
But still i cannot load the ios6.x simulator, it works for 7+, but 6 does not load at all. Its just a black screen.
Simulators older than 7.1 will not run correctly on OS X Yosemite. If you need iOS 6.1 and 7.0 simulators, you need to install Mavericks.
Similarly, if you need the iOS 5.1 and 6.0 simulators, you need Mountain Lion.

Xcode 5.1 crashing after installing Xcode6-beta version

The application "Xcode5.1.1" can't be opened.
I use x-code 5.1 to build iOS apps, now when i installed x-code6 beta version to implement app with swift language then xcode 5.1 is not working. It is giving me such error-
I use to resolve problem with Xcode 4.6.3 crashing after installing xcode 6 beta but not found this useful for my case.
I have tried to restart machine but it is giving same error. I googled for it but not got useful stuff. Any help would be appreciated.
Try to select different "Command line tools" in the bottom of Xcode -> Preferences -> Locations.
You can do it in your working Xcode 6.
After trying more I found it useful
Restart your machine then it can work, if not like my case then try below command in your Terminal
sudo mv /System/Library/PrivateFrameworks/MobileDevice.framework{,-saved}
then again restart your machine then it will ask for installing few components of Xcode so allow it, then your Xcode 5.1.1 will work fine.

Resources