Reputation: 85
The error I get when building a previously working project:
Images.xcassets: Failed to find a suitable device for the type SimDeviceType : com.apple.CoreSimulator.SimDeviceType.iPad-2 with runtime SimRuntime : 9.0 (13A4305g) - com.apple.CoreSimulator.SimRuntime.iOS-9-0
I've removed all references of Xcode and all simulators on my mac, restarted it so many times I can't count. This happened after the last release of El Capitan 2 days ago. The project was building and running fine before.. Why would the error originate from the Images.xcassets in the first place?
I can see xcode 7 beta 4 has all the simulators included in its package, but the list of available simulators is empty. To be noted I just want to run my project on a physical device and not the simulator (which freezes when open)
Log from the CoreSimulator that's been showing since the moment I upgraded OSX:
Jul 22 14:53:53 CoreSimulatorService[787] : com.apple.CoreSimulator.CoreSimulatorService 166~1 starting.
Managed to narrow it down to removing all the images from the Images.xcassets and adding an AppIcon and a LaunchImage to that. Builds ok, but whenever I attempt to add any other Image the build will fail again with the same error as mentioned above. It only builds if the images are left empty with no associated png files. Why though?
Upvotes: 5
Views: 3679
Reputation: 23641
The official discussion of a related issue is in Apple's forums, but people confuse both issues since they have similar characteristics.
The current El Capitan Beta has a bug which causes issues loading dyld_sim from older versions of the iOS Simulator in El Capitan.
Previous versions of El Capitan Beta had a different bug which caused CoreSimulatorService to crash (and thus limit simulator availability) if you had older legacy runtimes installed to /Library/Developer/CoreSimulator.
The workaround discussed in the forum post will work around both issues:
sudo xcode-select -s /path/to/Xcode-beta.app
[[ -d /Library/Developer/CoreSimulator ]] && sudo mv /Library/Developer/CoreSimulator{,.bak}
sudo mv $(xcrun --sdk iphonesimulator --show-sdk-path)/usr/lib/dyld_sim{,.bak}
sudo mv $(xcrun --sdk watchsimulator --show-sdk-path)/usr/lib/dyld_sim{,.bak}
Updating Xcode in the future will "undo" the change to Xcode.app. The newest Xcode.app beta, which was released after the El Capitan Beta, is not affected by this bug.
In the future, after a new El Capitan beta is released and you have updated, you will want to restore /Library/Developer/CoreSimulator if you moved it aside:
[[ -d /Library/Developer/CoreSimulator.bak ]] && sudo mv /Library/Developer/CoreSimulator{.bak,}
Upvotes: 0
Reputation: 4615
Try Delete all the files in these two path
rm -rf ~/Library/Developer/CoreSimulator
rm -rf ~/Library/Developer/Xcode
Upvotes: 1
Reputation: 85
Following the instructions here: support.apple.com/en-us/HT201314, reinstall OSX using Recovery. Before you do that, remove all Xcode references. After the os installation, reinstall Xcode and the project should be building just fine.
Upvotes: -3