Skip to content

Commit

Permalink
Merge pull request #4 from srahim/xcode5simissue
Browse files Browse the repository at this point in the history
Fixing Xcode 5 sim naming issue.
  • Loading branch information
vishalduggal committed Sep 6, 2013
2 parents 47bc02d + efb6a22 commit 3a36077
Showing 1 changed file with 32 additions and 3 deletions.
35 changes: 32 additions & 3 deletions Source/iPhoneSimulator.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
NSString *deviceProperty = @"SimulateDevice";
NSString *deviceIphoneRetina3_5Inch = @"iPhone (Retina 3.5-inch)";
NSString *deviceIphoneRetina4_0Inch = @"iPhone (Retina 4-inch)";
NSString *deviceIphoneRetina3_5InchiOS7 = @"iPhone Retina (3.5-inch)";
NSString *deviceIphoneRetina4_0InchiOS7 = @"iPhone Retina (4-inch)";
NSString *deviceIpadRetinaiOS7 = @"iPad Retina";
NSString *deviceIphone = @"iPhone";
NSString *deviceIpad = @"iPad";
NSString *deviceIpadRetina = @"iPad (Retina)";
Expand Down Expand Up @@ -54,18 +57,44 @@ - (void) printUsage {

- (void) findDeviceType:(NSString *)family withscaleFactor:(NSString*)deviceScale {
NSString *devicePropertyValue;
BOOL isiOS7 = NO;
NSArray *roots = [DTiPhoneSimulatorSystemRoot knownRoots];
for (DTiPhoneSimulatorSystemRoot *root in roots) {
if ([[root sdkVersion] isEqualToString:@"7.0"]) {
isiOS7 = YES;
break;
}
}
if (retinaDevice) {
if (verbose) {
nsprintf(@"using retina");
}
if ([family isEqualToString:@"ipad"]) {
devicePropertyValue = deviceIpadRetina;
if (isiOS7) {
nsprintf(@"using retina ipad ios 7");
devicePropertyValue = deviceIpadRetinaiOS7;
} else {
nsprintf(@"using retina ipad");
devicePropertyValue = deviceIpadRetina;
}
}
else {
if (tallDevice) {
devicePropertyValue = deviceIphoneRetina4_0Inch;
if (isiOS7) {
nsprintf(@"using retina iphone retina tall ios 7");
devicePropertyValue = deviceIphoneRetina4_0InchiOS7;
} else {
nsprintf(@"using retina iphone retina tall");
devicePropertyValue = deviceIphoneRetina4_0Inch;
}
} else {
devicePropertyValue = deviceIphoneRetina3_5Inch;
if (isiOS7) {
nsprintf(@"using retina iphone retina ios 7");
devicePropertyValue = deviceIphoneRetina3_5InchiOS7;
} else {
nsprintf(@"using retina iphone retina");
devicePropertyValue = deviceIphoneRetina3_5Inch;
}
}
}
} else {
Expand Down

0 comments on commit 3a36077

Please sign in to comment.