Xcode 9 Bug: Cannot find cdtool ...

After installing Xcode 9 beta, Xcode 8 gives me an error when compiling a project:


Cannot find cdtool at '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Xcode/Agents/cdtool': Cannot find a simulator runtime for platform <DVTPlatform:0x7fd67af0a930:'com.apple.platform.iphonesimulator':<DVTFilePath:0x7fd67af0a7c0:'/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform'>>.


I suspect Xcode 9 modified some shared state with Xcode 8 (set a path, overwrote a file, etc.). But I've tried deleting and both Xcodes to no avail.


The project uses Core Data and it's clearly failing when trying to compile the xcdatamodel.


I can still compile and run under Xcode 9.


Pretty stuck here, so would appreciate any help!!


Jason

Accepted Reply

Apple engineer reached out on this... Those of you with cdtool errors in Xcode 8, I suspect you installed the iOS 10.3 Simulator runtime from Xcode 9. It was discovered this week that this causes a problem with cdtool in Xcode 8.3. You can work around that by moving iOS 10.3.simruntime aside and restarting CoreSimulatorService: sudo mkdir /Library/Developer/CoreSimulator/Profiles/Runtimes/Backup sudo mv /Library/Developer/CoreSimulator/Profiles/Runtimes/{,Backup/}iOS 10.3.simruntime sudo killall -9 com.apple.CoreSimulator.CoreSimulatorService Then restart Xcode, Simulator, etc. Those of you that deleted CoreSimulator.framework and thus cannot run Xcode.app any more can reinstall CoreSimulator.framework with: installer -pkg /Applications/Xcode-beta.app/Contents/Resources/Packages/XcodeSystemResources.pkg -target /

Replies

Hello, I experience exactly the same problem.


/<***>xcdatamodeld/version 1.1.xcdatamodel: Cannot find cdtool at '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Xcode/Agents/cdtool': Cannot find a simulator runtime for platform <DVTPlatform:0x7f84a1a0afd0:'com.apple.platform.iphonesimulator':<DVTFilePath:0x7f84a1a0ae60:'/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform'>>.


I have XCode 9 installed and the error is in XCode 8 (everything's working fine in XCode 9).


But the problem only manifested after I tried to archive a build in XCode 8. Before that the simulator worked fine.

Apps ran side by side ok at first. The only thing I did that may have caused a problem is added the 10.3 simulator to Xcode 9. Could have nothing to do with it.


IVe looked through all the Library/Developer directories to find anything that may be persisting between installs and just can't find anything!

Apple engineer reached out on this... Those of you with cdtool errors in Xcode 8, I suspect you installed the iOS 10.3 Simulator runtime from Xcode 9. It was discovered this week that this causes a problem with cdtool in Xcode 8.3. You can work around that by moving iOS 10.3.simruntime aside and restarting CoreSimulatorService: sudo mkdir /Library/Developer/CoreSimulator/Profiles/Runtimes/Backup sudo mv /Library/Developer/CoreSimulator/Profiles/Runtimes/{,Backup/}iOS 10.3.simruntime sudo killall -9 com.apple.CoreSimulator.CoreSimulatorService Then restart Xcode, Simulator, etc. Those of you that deleted CoreSimulator.framework and thus cannot run Xcode.app any more can reinstall CoreSimulator.framework with: installer -pkg /Applications/Xcode-beta.app/Contents/Resources/Packages/XcodeSystemResources.pkg -target /

Thanks SO MUCH ! It WORKED !!

I had the same problem and this fix made my day! 🙂

Thank you so much.

It worked.

Thanks! Trying to get some better formatting of the commands for easier copy/pasting.

sudo mkdir /Library/Developer/CoreSimulator/Profiles/Runtimes/Backup
sudo mv "/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 10.3.simruntime" "/Library/Developer/CoreSimulator/Profiles/Runtimes/Backup/"
sudo killall -9 com.apple.CoreSimulator.CoreSimulatorService

thanks a lot! it worked to me in xcode 8.3.2