Xcode failing to re-install app in simulator

Number:rdar://46390751 Date Originated:November 30, 2018
Status:Open Resolved:
Product:Xcode Product Version:Version 10.1 (10B61)
Classification:Other bug Reproducible:Yes

I was having a hard time with the error in the attached screenshot. I could build-and-run on a simulator, but if I quit the simulator and build-and-ran again, it would fail. I could fix it only by deleting the app from the simulator. 

On the suggestion of Russ Bishop ( https://twitter.com/xenadu02/status/1068629603684573184 ) I ran an xcrun simctl diagnose (attached). It was a good suggestion, becuase I checked CoreSimulator.log and found the following line:

> Nov 30 20:04:00 Open-Source-by-Detente com.apple.CoreSimulator.simctl[81038] <Warning>: Unable to determine how to handle launch_sim_unregister_endpoint for runtime com.apple.CoreSimulator.SimRuntime.iOS-8-1 (handle=0x7f898046b660)

Looks like it was trying to do something with the 8.1 simulator even though it's not installed, which is why I think it was failing. Xcode was still listing 8.1 as being installed in its settings' Components pane, but I think I had deleted it from the Device Support folder to reclaim disk space. This may have been around when this started, I can't remember.

I eventually tracked down this file and deleted it:

/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS\ 8.1.simruntime

Everything is working now, thanks!

Steps to Reproduce:

- Build and run a project, wait for simulator to launch
- Quit the simulator app
- Build and run again, and get the error


Xcode Version 10.1 (10B61)


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!