Browse Source

uikit open simulator, simplify availability condition (#2414)

pull/2416/head v1.3.0-alpha01-dev824
dima.avdeev 2 years ago committed by GitHub
parent
commit
0554616489
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/experimental/uikit/internal/SimctlListData.kt
  2. 4
      gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/experimental/uikit/internal/registerSimulatorTasks.kt

6
gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/experimental/uikit/internal/SimctlListData.kt

@ -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,
)

4
gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/experimental/uikit/internal/registerSimulatorTasks.kt

@ -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(

Loading…
Cancel
Save