Skip to content

Commit

Permalink
uikit open simulator, simplify availability condition (#2414)
Browse files Browse the repository at this point in the history
  • Loading branch information
dima-avdeev-jb authored Oct 17, 2022
1 parent 11fad5e commit 0554616
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@ internal class DeviceData(
val dataPathSize: Long? = null,
val logPath: String? = null,
val udid: String,
val isAvailable: Boolean? = null,
/**
* Simulator may be unavailable after update Xcode version.
* By default, we think what simulator is available.
*/
val isAvailable: Boolean = true,
val deviceTypeIdentifier: String? = null,
val state: String,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ fun Project.registerSimulatorTasks(
doLast {
val device = getSimctlListData().devices.map { it.value }.flatten()
.firstOrNull { device: DeviceData ->
val xcode13Condition = device.state.contains("unavailable")
val xcode14Condition = device.isAvailable == false
device.name == deviceName && (xcode13Condition || xcode14Condition)
device.name == deviceName && !device.isAvailable
}
if (device != null) {
runExternalTool(
Expand Down

0 comments on commit 0554616

Please sign in to comment.