How to disable system location alert in iOS simulator

扶醉桌前 提交于 2020-01-04 04:40:09

问题


I use KIF framework (http://github.com/kif-framework/KIF) with Xcode Continuous Integration Server for UI testing.

When XCode CI server start app in iOS Simulator system alert "Application would like to use your current location" appears.

I use this delegate

- (void)locationManager:(CLLocationManager *)manager didChangeAuthorizationStatus: (CLAuthorizationStatus)status

to get the notification that user allows to use location and I need it to keep like it is.

  1. Is it possible to tap OK on this system alert with KIF ? I didn't found out the way.
  2. Or how to allow application use location service in simulator without showing this alert ?

回答1:


According to this answer from the top KIF contributor, dismissing system alerts automatically is impossible, and you should therefore mock (i.e. provide a substitute for) the location service so that you can test your code without running into the alert.



来源:https://stackoverflow.com/questions/22530311/how-to-disable-system-location-alert-in-ios-simulator

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!