|
1 | 1 | package ios.simctl
|
2 | 2 |
|
3 | 3 | import com.github.michaelbull.result.Result
|
| 4 | +import com.github.michaelbull.result.onFailure |
4 | 5 | import com.github.michaelbull.result.runCatching
|
5 | 6 | import hierarchy.ViewHierarchy
|
6 | 7 | import ios.IOSDevice
|
@@ -167,13 +168,19 @@ class SimctlIOSDevice(
|
167 | 168 | }
|
168 | 169 |
|
169 | 170 | override fun setPermissions(id: String, permissions: Map<String, String>) {
|
170 |
| - logger.info("[Start] Setting permissions through applesimutils") |
171 |
| - LocalSimulatorUtils.setPermissions(deviceId, id, permissions) |
172 |
| - logger.info("[Done] Setting permissions through applesimutils") |
| 171 | + val formattedPermissions = permissions.entries.joinToString(separator = ", ") { "${it.key}=${it.value}" } |
| 172 | + |
| 173 | + runCatching { |
| 174 | + logger.info("[Start] Setting permissions $formattedPermissions through applesimutils") |
| 175 | + LocalSimulatorUtils.setAppleSimutilsPermissions(deviceId, id, permissions) |
| 176 | + logger.info("[Done] Setting permissions through applesimutils") |
| 177 | + }.onFailure { |
| 178 | + logger.error("Failed setting permissions $permissions via applesimutils", it) |
| 179 | + } |
173 | 180 |
|
174 |
| - logger.info("[Start] Setting Permissions through simctl") |
| 181 | + logger.info("[Start] Setting Permissions $formattedPermissions through simctl") |
175 | 182 | LocalSimulatorUtils.setSimctlPermissions(deviceId, id, permissions)
|
176 |
| - logger.info("[Done] Setting Permissions through simctl") |
| 183 | + logger.info("[Done] Setting Permissions $formattedPermissions through simctl") |
177 | 184 | }
|
178 | 185 |
|
179 | 186 | override fun eraseText(charactersToErase: Int) {
|
|
0 commit comments