I have a simple app running on ios simulator which will (at some point in the app), prompt the user to authorize the following:
- Location setting
- Address contact book
- Pictures/Albums
Because I am doing automation testing on the iOS simulator (several thousand on virtual machines), is there a way to force iOS simulator to have these permissions already set to yes when the app is installed?
I vaguely remember there was a way to manipulate this using a plist file associated with iOS simulator, but I'm not 100% sure if "its all in my head". I'm not finding much on google.
There's some discussion here on this topic. I'll quote the relevant portion for posterity:
(Make sure to take this stuff out when you submit your app - or only include it in your debug target - because it won't pass app review.)
Based on the comment by Felipe Sabino above I worked out the following. The permissions file of iOS for Xcode 6 is stored at location:
~/Library/Developer/CoreSimulator/Devices/<device>/data/Library/TCC/TCC.db
. So we modify the db file using sqlite3 on the console.Used the following Perl script from terminal. This could be done in any language really.
This one overrides
kTCCServiceAddressBook
permission, but there is alsokTCCServiceCalendar
andkTCCServicePhotos
.