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?

Cœur
  • 37,241
  • 25
  • 195
  • 267
OrangeDog
  • 36,653
  • 12
  • 122
  • 207

1 Answers1

1

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"];

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

Community
  • 1
  • 1
OrangeDog
  • 36,653
  • 12
  • 122
  • 207