简体   繁体   English

重置对 iOS 模拟器中联系人的访问权限?

[英]Reset access to contacts in iOS simulator?

I want to test out the contact authorization process, but the simulator doesn't ask me for permission anymore.我想测试联系授权过程,但模拟器不再请求我的许可。 I've tried resetting privacy settings, I've tried resetting the simulator completely, I've tried deleting the app, but no matter what, it never asks me for permission.我试过重置隐私设置,我试过完全重置模拟器,我试过删除应用程序,但无论如何,它从不征求我的许可。 It just assumes I've granted it.它只是假设我已经授予了它。

I'm running iOS 6 simulator.我正在运行 iOS 6 模拟器。 There are a couple similar questions like this on SO, but surprisingly no decent answers. SO上有几个类似的问题,但令人惊讶的是没有像样的答案。 Is there really no way to do this?真的没有办法做到这一点吗?

从iOS 7开始,转到“设置”,“常规”,“重置”,然后点击“重置位置和隐私”

The reset locations/privacy option ONLY works on a device. 重置位置/隐私选项仅适用于设备。 It doesn't work in the simulator. 它在模拟器中不起作用。

Edit: This is no longer true, see laktak's answer. 编辑:这不再是真的,请参阅laktak的回答。

These instructions are for Xcode 6. 这些说明适用于Xcode 6。

  1. Find the identifier of the simulator whose access settings you want to reset in Xcode's Devices window. 在Xcode的“设备”窗口中找到要重置其访问设置的模拟器的标识符。

  2. Delete ~/Library/Developer/CoreSimulator/Devices/<device>/data/Library/TCC/TCC.db 删除~/Library/Developer/CoreSimulator/Devices/<device>/data/Library/TCC/TCC.db

  3. Relaunch the simulator. 重新启动模拟器。

Seems like this has changed.似乎这已经改变了。 To reset permissions go to:要重置权限,请转到:

Settings > Privacy > Contacts设置 > 隐私 > 通讯录

您现在可以使用xcrun simctl privacy<\/code>来控制这些设置。

例子:

  • xcrun simctl privacy booted reset all<\/code>将为当前启动的模拟器中安装的所有应用程序重置所有支持的权限。<\/li>
  • xcrun simctl privacy booted revoke contacts com.example.my-app<\/code>将拒绝对当前启动模拟器上给定 Bundle ID 的完全联系人访问权限。<\/li><\/ul>

    有关更多详细信息,请参阅xcrun simctl help privacy<\/code> 。

    "

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM