UITesting失败获取活动应用程序列表

点击按钮打开Facebook登录页面,点击完成按钮,返回主视图控制器。

这是我通过录制获得的代码

override func setUp() { super.setUp() XCUIApplication().launch() } func testExample() { let app = XCUIApplication() app.buttons["Button"].tap() app.buttons["Done"].tap() } 

但是,当我运行录制时,它会在testExample()的第二行中testExample()这是错误: UI Testing Failure - Failure getting list of active applications: AX error -25205

请务必在设备上“启用UI Atomation”(设置>开发者)。

(我必须重新启动设备才能使其生效)