diff --git a/maestro-ios-driver/src/main/kotlin/util/LocalSimulatorUtils.kt b/maestro-ios-driver/src/main/kotlin/util/LocalSimulatorUtils.kt index 6618b2de9f..4607db6456 100644 --- a/maestro-ios-driver/src/main/kotlin/util/LocalSimulatorUtils.kt +++ b/maestro-ios-driver/src/main/kotlin/util/LocalSimulatorUtils.kt @@ -416,7 +416,7 @@ object LocalSimulatorUtils { ) } - fun setPermissions(deviceId: String, bundleId: String, permissions: Map) { + fun setAppleSimutilsPermissions(deviceId: String, bundleId: String, permissions: Map) { val permissionsMap = permissions.toMutableMap() if (permissionsMap.containsKey("all")) { val value = permissionsMap.remove("all") diff --git a/maestro-ios/src/main/java/ios/simctl/SimctlIOSDevice.kt b/maestro-ios/src/main/java/ios/simctl/SimctlIOSDevice.kt index 0bbe584969..0c2215b154 100644 --- a/maestro-ios/src/main/java/ios/simctl/SimctlIOSDevice.kt +++ b/maestro-ios/src/main/java/ios/simctl/SimctlIOSDevice.kt @@ -1,6 +1,7 @@ package ios.simctl import com.github.michaelbull.result.Result +import com.github.michaelbull.result.onFailure import com.github.michaelbull.result.runCatching import hierarchy.ViewHierarchy import ios.IOSDevice @@ -167,13 +168,17 @@ class SimctlIOSDevice( } override fun setPermissions(id: String, permissions: Map) { - logger.info("[Start] Setting permissions through applesimutils") - LocalSimulatorUtils.setPermissions(deviceId, id, permissions) + val formattedPermissions = permissions.entries.joinToString(separator = ", ") { "${it.key}=${it.value}" } + + logger.info("[Start] Setting permissions $formattedPermissions through applesimutils") + runCatching { LocalSimulatorUtils.setAppleSimutilsPermissions(deviceId, id, permissions) }.onFailure { + logger.error("Failed setting permissions $permissions via applesimutils", it) + } logger.info("[Done] Setting permissions through applesimutils") - logger.info("[Start] Setting Permissions through simctl") + logger.info("[Start] Setting Permissions $formattedPermissions through simctl") LocalSimulatorUtils.setSimctlPermissions(deviceId, id, permissions) - logger.info("[Done] Setting Permissions through simctl") + logger.info("[Done] Setting Permissions $formattedPermissions through simctl") } override fun eraseText(charactersToErase: Int) {