XCUIApplication: How to set a custom core location

In Xcode 7 Apple added XCUITest as the new and preferred way to test the UI of your application.

I want to migrate my old testing script, but haven't found any information on how to set a custom core location when using XCUITest.

Old call:

UIATarget.localTarget().setLocation({latitude: '48.21048', longitude: '16.3595'});

I also tried to find some information on how to provide a GPX-File as a workaround via launch arguments, but had no success and idea if this is possible and what the key would be.

Does anyone know how to set a custom core location using XCUITest?


WWDC Session 409 Advanced Testing and Continuous Integration WWDC 2016 offers a big clue on this.

In short, it's not possible. At least as of Xcode 8.

Apple engineers in the video configure the location - or rather, they disable location - manually using the simulator settings.

To run a Bot against a specific location, one must first create the new simulator using the CI machine's Xcode Devices. Then, edit the Bot and select "Specific iOS Devices" on the Devices tab.

链接地址: http://www.djcxy.com/p/88962.html

上一篇: 类的Parse列值始终为零

下一篇: XCUIApplication:如何设置自定义核心位置