Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Crash on Xcode 8.0 GM iPhone Simulator (iOS 10)

Tags:

xcode

ios

When I run my project on real device , everything works fine.

But when I try to run it on the simulators(iOS 10,iPhone 7 && iPhone 6) ,the app crashed and no debugger messages in the Debugger Output.

The crashed Thread look like this

enter image description here

I want to know what the

TCC`CRASHING_DUE_TO_PRIVACY_VIOLATION

means , and how to fix the problem?

like image 225
wj2061 Avatar asked Sep 08 '16 07:09

wj2061


People also ask

Can we run iOS simulator without Xcode?

Launching the Simulator, though, always requires opening Xcode and going to Developer Tools. Because the Simulator. app is embedded within the Xcode app bundle, apps like LaunchBar won't find it to index it.

How do I reinstall Xcode simulator?

Open Xcode and click Menu > Xcode > Preferences > Select Components, and then choose the simulator version you want to download. When a simulator is opened from AppStudio, AppStudio Player automatically installs (if necessary) and opens in it.

How do I use iPhone simulator in Xcode?

To launch a Simulator without running an app Launch Xcode. Do one of the following: Choose Xcode > Open Developer Tool > Simulator. Control-click the Xcode icon in the Dock, and from the shortcut menu, choose Open Developer Tool > Simulator.


1 Answers

Are you using a feature that requires user approval (like Camera, Location, etc)? TCC handles access to such resources and a crash in __CRASHING_DUE_TO_PRIVACY_VIOLATION__ usually means you aren't fulfilling the requirements to use that feature.

Make sure you have the usage description key for any of those features in your Info.plist file. iOS 10 now absolutely requires you supply descriptions such as:

<key>NSCameraUsageDescription</key>
<string>For taking selfies!</string>

It is probably working on your device because you previously granted permission. If you delete the app and wait 24 hours (or install on a different device that has never had the app installed before) you'd probably see the same thing on device. (Different services have different policies for whether permission disappears quickly or is saved for a while to allow for reinstalls).

Update:

There is a nice Technical Q&A page on developer.apple.com that describes the frameworks that require a usage description and lists the relevant key(s) for each framework and the class/function/selector(s) involved.

like image 110
russbishop Avatar answered Oct 02 '22 22:10

russbishop