diff --git a/packages/patrol/CHANGELOG.md b/packages/patrol/CHANGELOG.md index beec35e20..9d7c666f2 100644 --- a/packages/patrol/CHANGELOG.md +++ b/packages/patrol/CHANGELOG.md @@ -3,6 +3,7 @@ - Implement `enableBluetooth` and `disableBluetooth` methods for Android > 11. (#2254) - Implement `enableAirplaneMode` and `disableAirplaneMode` methods for Android. (#2254) - Implement `enableLocation` and `disableLocation` methods for Android. (#2259) +- Fix opening settings app with clean state on iOS. (#2275) ## 3.9.0 diff --git a/packages/patrol/darwin/Classes/AutomatorServer/Automator/IOSAutomator.swift b/packages/patrol/darwin/Classes/AutomatorServer/Automator/IOSAutomator.swift index 0db23d1be..c6d8cad85 100644 --- a/packages/patrol/darwin/Classes/AutomatorServer/Automator/IOSAutomator.swift +++ b/packages/patrol/darwin/Classes/AutomatorServer/Automator/IOSAutomator.swift @@ -1002,7 +1002,8 @@ ) throws { try runAction(log) { self.springboard.activate() - self.preferences.launch() // reset to a known state + self.preferences.activate() // Needed to make sure that settings will be opened with a clean state + self.preferences.launch() block() diff --git a/packages/patrol/darwin/Classes/AutomatorServer/AutomatorServer.swift b/packages/patrol/darwin/Classes/AutomatorServer/AutomatorServer.swift index a18c69212..e8c1f3a8f 100644 --- a/packages/patrol/darwin/Classes/AutomatorServer/AutomatorServer.swift +++ b/packages/patrol/darwin/Classes/AutomatorServer/AutomatorServer.swift @@ -283,13 +283,13 @@ } } - func enableBluetooth() throws { + func enableLocation() throws { return try runCatching { try automator.enableLocation() } } - func disableBluetooth() throws { + func disableLocation() throws { return try runCatching { try automator.disableLocation() }