Search code examples
iosautomated-testsabaddressbookalassetslibraryuser-permissions

Automated test ABAddressBook and ALAssetsLibrary request access


I have a large suite of automated tests for my app. I would like to add tests for my wrappers around ABAddressBook and ALAssetsLibrary. However, if these tests run on a simulator that has never accessed either the address book or an asset library in the past, then a request for permission is made to the user.

I'd like to know if anyone has had success bypassing this request in an automated test suite of theirs?


Solution

  • This answer is working, as Awesome-o said: https://stackoverflow.com/a/28473742/1979235 (with some modifications, which I will comment on there)