问题
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.
- Is it possible to tap OK on this system alert with KIF ? I didn't found out the way.
- 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