From fe06082951220512182a2982caceed71473228f5 Mon Sep 17 00:00:00 2001 From: piotruela Date: Mon, 22 Jul 2024 14:52:59 +0200 Subject: [PATCH 1/4] Fix opening settings app with clean state on iOS --- .../Classes/AutomatorServer/Automator/IOSAutomator.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/patrol/darwin/Classes/AutomatorServer/Automator/IOSAutomator.swift b/packages/patrol/darwin/Classes/AutomatorServer/Automator/IOSAutomator.swift index 0db23d1be..4871c9df7 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() From 1c4e2c6ff4446285ef05f4701d2dba326f1fb144 Mon Sep 17 00:00:00 2001 From: piotruela Date: Wed, 24 Jul 2024 10:08:23 +0200 Subject: [PATCH 2/4] Format swift code --- .../darwin/Classes/AutomatorServer/Automator/IOSAutomator.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/patrol/darwin/Classes/AutomatorServer/Automator/IOSAutomator.swift b/packages/patrol/darwin/Classes/AutomatorServer/Automator/IOSAutomator.swift index 4871c9df7..c6d8cad85 100644 --- a/packages/patrol/darwin/Classes/AutomatorServer/Automator/IOSAutomator.swift +++ b/packages/patrol/darwin/Classes/AutomatorServer/Automator/IOSAutomator.swift @@ -1002,7 +1002,7 @@ ) throws { try runAction(log) { self.springboard.activate() - self.preferences.activate() // Needed to make sure that settings will be opened with a clean state + self.preferences.activate() // Needed to make sure that settings will be opened with a clean state self.preferences.launch() block() From fee809f1eee2e4960de502f7ba7569c7d2b07bc0 Mon Sep 17 00:00:00 2001 From: piotruela Date: Wed, 24 Jul 2024 10:12:41 +0200 Subject: [PATCH 3/4] Update changelog --- packages/patrol/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) 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 From 2aca175d34e6a443f60e4b43918e8493781de300 Mon Sep 17 00:00:00 2001 From: piotruela Date: Thu, 25 Jul 2024 20:48:53 +0200 Subject: [PATCH 4/4] Fix AutomatorServer.swift --- .../darwin/Classes/AutomatorServer/AutomatorServer.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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() }