In Xcode 10.2 I can no longer run my app on a simulator with thread sanitizer enabled. I get the error
This app could not be installed at this time.
WatchKit v3 app has disallowed Info.plist key: NSBuiltWithThreadSanitizer
My app includes a watch app and a lot of frameworks (some for watch, some for iOS), but I get this error when trying to run my main app on a simulator. I checked my plist files and confirmed that this is not a key I specified anywhere.
When I check the plist files in DerivedData, I see that indeed all of the plists for my watch OS frameworks have this key. But the only way I can find to remove the flag is to disable thread sanitizer completely. How do I disable it just for the watch and not my main app?
The basic way to open a list of simulators is to use Xcode -> Window -> Devices and Simulators. Here you can create and manage all available simulators. But you cannot run them directly. You need to build your application on the simulator, and then you can run it.
Select a Simulated Device For iOS, tvOS, and watchOS apps, you can choose a simulated device, under [Platform] Simulators, from the run destination menu next to the scheme menu in the toolbar.
Open Xcode and click Menu > Xcode > Preferences > Select Components, and then choose the simulator version you want to download.
Depending on what your use case is, another workaround is to remove the watch target from your main app temporarily: Prevent deploying (disable) WatchKit App with iOS iPhone App in Xcode (remove from Project File settings, Build Phase -> Target Dependencies, and Build Phase -> Embed Watch Content)
You can quickly restore this with version control after your debugging session.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With