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?

Max
  • 21,123
  • 5
  • 49
  • 71
  • 1
    I am running in to the same problem. Did you find a fix? – duncanc4 Apr 25 '19 at 12:46
  • @duncanc4 Not yet – Max Apr 25 '19 at 13:43
  • 1
    I submitted a bug report to apple, radar://50206337 – duncanc4 Apr 25 '19 at 15:31
  • 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. – Isaac Apr 30 '19 at 12:49
  • @Isaac 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... – Max Apr 30 '19 at 12:55
  • 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... – Isaac Apr 30 '19 at 13:22
  • @duncanc4 is radar still opened? I can't find it – Yury Aug 30 '19 at 08:33
  • 1
    @ShadowOf Mine is still open, but they commented saying it was a duplicate of another. – duncanc4 Aug 30 '19 at 15:58

2 Answers2

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.

J. Song
  • 85
  • 6
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.

Max
  • 21,123
  • 5
  • 49
  • 71