-
Notifications
You must be signed in to change notification settings - Fork 906
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: prevent booting already booted simulators #2033
fix: prevent booting already booted simulators #2033
Conversation
de7eeee
to
0e1c755
Compare
@szymonrybczak |
@badbeoti Hey, so by default since React Native 0.71, we get booted simulators (and devices), and we launch app on them, so even if user doesn't have installed |
@badbeoti I checked this right and we're checking if |
@szymonrybczak |
@okwasniewski would you mind looking at this and whether we're not cutting out support for older (but still supported) Xcode versions? |
@thymikee Unfortunately, I'm not sure about the support for the older Xcode versions. However, I have the same logic for checking booted simulators in MiniSim so this shouldn't be an issue. |
I think I can help with that question @thymikee. Xcode 14.2 is the earliest version supported by Apple if you want to upload binaries to the App Store: https://developer.apple.com/news/?id=jd9wcyov So I'm assuming that's as far back as you need to support? I've just tried the ~ via v18.17.1
❯ xcode-select -p
/Applications/Xcode14.2.app/Contents/Developer
~ via v18.17.1
❯ xcrun simctl list --json devices
{
"devices" : {
"com.apple.CoreSimulator.SimRuntime.watchOS-9-4" : [
{
"lastBootedAt" : "2023-08-11T08:24:48Z",
"dataPath" : "\/Users\/liam.jones\/Library\/Developer\/CoreSimulator\/Devices\/58DDD451-8F10-4869-AB6C-878A9C441530\/data",
"dataPathSize" : 130007040,
"logPath" : "\/Users\/liam.jones\/Library\/Logs\/CoreSimulator\/58DDD451-8F10-4869-AB6C-878A9C441530",
"udid" : "58DDD451-8F10-4869-AB6C-878A9C441530",
"isAvailable" : true,
"logPathSize" : 20480,
"deviceTypeIdentifier" : "com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-5-40mm",
"state" : "Shutdown",
"name" : "Apple Watch Series 5 (40mm)"
}
],
"com.apple.CoreSimulator.SimRuntime.iOS-16-4" : [
{
"lastBootedAt" : "2023-07-25T15:55:17Z",
"dataPath" : "\/Users\/liam.jones\/Library\/Developer\/CoreSimulator\/Devices\/F345B3A6-1B93-4C69-97E2-9D33F5114921\/data",
"dataPathSize" : 81960960,
"logPath" : "\/Users\/liam.jones\/Library\/Logs\/CoreSimulator\/F345B3A6-1B93-4C69-97E2-9D33F5114921",
"udid" : "F345B3A6-1B93-4C69-97E2-9D33F5114921",
"isAvailable" : false,
"availabilityError" : "runtime profile not found using \"System\" match policy",
"logPathSize" : 20480,
"deviceTypeIdentifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-SE-3rd-generation",
"state" : "Shutdown",
"name" : "iPhone SE (3rd generation)"
}
],
"com.apple.CoreSimulator.SimRuntime.iOS-16-2" : [
{
"lastBootedAt" : "2023-08-11T08:25:12Z",
"dataPath" : "\/Users\/liam.jones\/Library\/Developer\/CoreSimulator\/Devices\/7386593E-A5AF-44AB-AAC6-01B8475AB2AE\/data",
"dataPathSize" : 315113472,
"logPath" : "\/Users\/liam.jones\/Library\/Logs\/CoreSimulator\/7386593E-A5AF-44AB-AAC6-01B8475AB2AE",
"udid" : "7386593E-A5AF-44AB-AAC6-01B8475AB2AE",
"isAvailable" : true,
"logPathSize" : 40960,
"deviceTypeIdentifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-8",
"state" : "Booted",
"name" : "iPhone 8"
}
]
}
} |
Summary:
Fixes: #2032
The
if
statement was checkingbooted
value, but in some code path, thebooted
value didn't exist. I unified this, to usestate
field.Test Plan:
You should see booted simulator, and this simulator shouldn't boot another time.
Checklist