How to set which iOS simulator to use for tests? I...
# multiplatform
k
How to set which iOS simulator to use for tests? I don’t have
iPhone 12
in my simulator list and
iosX64Test
task fails with
Copy code
Invalid device: iPhone 12
java.lang.IllegalStateException: command '/usr/bin/xcrun' exited with errors (exit code: 148)
☝️ 1
Found it, can be set on simulator targets:
Copy code
listOf(
        iosX64(),
        iosSimulatorArm64()
    ).forEach { target ->
        target.testRuns.forEach { tr ->
            tr.deviceId = properties["iosSimulatorName"] as? String ?: "iPhone X"
        }
    }
👍 2
m
I looked for this problem here on Slack and found this thread. For us, we didn’t override the iOS simulator name using @krzysztof’s solution, but we created a new
iPhone 12
device using the iPhone 14 runtime using the command
xcrun simctl create "iPhone 12" "iPhone 14"
Then the new simulator also shows up in the simulator list:
xcrun simctl list
Still, it would be better if KMM would work by default, starting with Xcode 14 and onward. Does anyone know if there’s a fix being prepared for KMM? Because otherwise trying to run the tests will fail there by default.
Or is there a YouTrack issue at least?
m
I have the same Issue, leaving a comment to track.
l
I’m wondering why Apple removed all the older simulators with XCode 14. Isn’t the iPhone 12 still a reasonable device that I may WANT to test?
555 Views