0

EDIT - Do not close the question. It is not asking about location services. It is not a duplicate Can now be closed, I have found the answer and posted link in comments

I'm doing automation testing on the iOS simulator. Using code, I can tap on objects shown on the simulator for my app. eg, UIAlertView and UIButton objects etc etc.

How do I suppress (or tap on) alert views that are OUTSIDE the scope of my app? For instance, if I navigated to a section of my app that interacts with addressbook, I get the privacy alert message asking for permission. This UIAlert seems to be an iOS system message, and not a normal UIAlertView that is usually generated within my app. As a result, I cannot retrieve the object through code to tap on it.

Does any one know a way to launch an App in simulator (not on the iphone.. this is all automation testing purposes) in such a way that privacy alerts such as these are suppressed?

Just a coder
  • 15,480
  • 16
  • 85
  • 138
  • possible duplicate of [How to disable system location alert in iOS simulator](http://stackoverflow.com/questions/22530311/how-to-disable-system-location-alert-in-ios-simulator) – Paulw11 May 08 '14 at 23:30
  • @Paulw11 the location alert i know how to fix. The one i was wondering about was the contactbook privacy alert. The one that asks permission for app to use the contact book, and the other that asks permission for app to use camera photos. – Just a coder May 09 '14 at 00:01
  • Unfortunately it falls into the same situation - you cannot accept it programatically. – Paulw11 May 09 '14 at 00:03
  • It cannot be fixed programatically, but can the app be launched with these settings disabled? i saw a solution on this link -> https://groups.google.com/forum/#!topic/kif-framework/xayP4VVBPyg But the answer might be outdated. So i wanted to know if any one has a new solution – Just a coder May 09 '14 at 00:09
  • 1
    Might be useful: https://github.com/facebook/xctool/issues/276 – iamamused May 09 '14 at 01:53
  • I Have supplied an answer [here][1] [1]: https://stackoverflow.com/questions/28443578/ios-permission-alerts-removing-or-surpressing – Just a coder May 10 '15 at 00:52

0 Answers0