0

Same question as this one, but for iOS 8.

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

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?

4

1 回答 1

1

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

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

“访问”表的架构是相同的。

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 仅适用于帐户访问(联系人、邮件等),并非所有权限。

于 2015-05-07T16:28:17.713 回答