操纵iOS 8模拟器上的应用程序权限 [英] Manipulate app permissions on iOS 8 simulator

查看:174
本文介绍了操纵iOS 8模拟器上的应用程序权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这一个相同,但适用于iOS 8。

Same question as this one, but for iOS 8.

在运行xctests时,如何确保以编程方式授予/拒绝权限?

While running xctests, how can I make sure permissions are granted/denied programmatically?

是否使用了相同的TCC.db?如果是这样,因为没有 $ HOME / Library / Application Support / iPhone Simulator / 8.x 目录,它在哪里移动到?

Is the same TCC.db used? If so, as there are no $HOME/Library/Application Support/iPhone Simulator/8.x directories, where has it moved to?

推荐答案

感谢用户名tbd ,TCC.db仍然在使用,但现在位于

Thanks to username tbd, the TCC.db is still in use, but is now located at

$ HOME / Library / Developer / CoreSimulator / Devices / $ DEVICEID / data / Library / TCC /

访问表的模式是相同的。

Schema of the "access" table is the same.

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *dbPath = [paths firstObject];

for (int ii = 0; ii < 5; ii++) {
    dbPath = [dbPath stringByDeletingLastPathComponent];
}

dbPath = [[[dbPath stringByAppendingPathComponent:@"Library"]
           stringByAppendingPathComponent:@"TCC"]
          stringByAppendingPathComponent:@"TCC.db"];

注意虽然TCC仅用于帐户访问(联系人,邮件等)而不是所有权限。

Note though that TCC is only for Accounts access (contacts, mail, etc.) and not all permissions.

这篇关于操纵iOS 8模拟器上的应用程序权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆