简体   繁体   中英

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. There are a couple similar questions like this on SO, but surprisingly no decent answers. 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.

These instructions are for Xcode 6.

  1. Find the identifier of the simulator whose access settings you want to reset in Xcode's Devices window.

  2. Delete ~/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> 。

    "

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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