Can't run iOS app on simulator in Xcode 10.2
Asked Answered
I

2

6

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?

Izawa answered 23/4, 2019 at 19:42 Comment(8)
I am running in to the same problem. Did you find a fix? – Basin
@Basin Not yet πŸ™ – Izawa
I submitted a bug report to apple, radar://50206337 – Basin
Same here, Xcode version is 10.2.1... Can't find that key anywhere on the info.plist it says. Getting inside "Edit Schema" for my watch targets shows a "disabled" checkbox for ThreadSanitizing, so I can't do anything. – Delorsedelos
@Delorsedelos you have to disable thread sanitizer for your app target, not the watch targets. It makes no sense, but that's what works for me... – Izawa
The thing is I've been disabling this setting for the whole 10.2 beta program, as it was a BUILD TIME crash... Whenever 10.2.1 was released, its changelog apparently said something about "NSThreadSanitizer" is finally working again. So we reenabled it... The build phase doesn't crash anymore, but deployment phase shows this new error... – Delorsedelos
@Basin is radar still opened? I can't find it – Spondee
@ShadowOf Mine is still open, but they commented saying it was a duplicate of another. – Basin
S
3

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.

Sententious answered 5/6, 2019 at 23:52 Comment(0)
I
1

In the Xcode 11 beta running on Mac OS Catalina, this issue seems to have disappeared. That points to it being a bug on Apple's end, so hopefully we'll see an Xcode 10 update with a fix.

Izawa answered 5/6, 2019 at 19:46 Comment(0)

© 2022 - 2024 β€” McMap. All rights reserved.