Skip to content

Commit

Permalink
Fix incorrect os version for simulators
Browse files Browse the repository at this point in the history
Reviewed By: lawrencelomax

Differential Revision: D57011949

fbshipit-source-id: 34ab6ec8c8aec6afc275fda588f9218be16ad4fb
  • Loading branch information
Adam Ernst authored and facebook-github-bot committed May 7, 2024
1 parent 5ff7c92 commit 45666c7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions FBSimulatorControl/Configuration/FBSimulatorConfiguration.m
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,11 @@ - (instancetype)withOS:(FBOSVersion *)os
- (instancetype)withDevice:(FBDeviceType *)device
{
NSParameterAssert(device);
// Use the current os if compatible
// Use the current os if compatible.
// If os.families is empty, it was probably created via [FBOSVersion +genericWithName:]
// which has no information about families; in that case we assume it is compatible.
FBOSVersion *os = self.os;
if ([os.families containsObject:@(device.family)]) {
if (!os.families.count || [os.families containsObject:@(device.family)]) {
return [[FBSimulatorConfiguration alloc] initWithNamedDevice:device os:os];
}
// Attempt to find the newest OS for this device, otherwise use what we had before.
Expand Down

0 comments on commit 45666c7

Please sign in to comment.