Skip to content

Commit 02e4eec

Browse files
author
David Arata
committed
added support for 64bit simulators
1 parent c628c9e commit 02e4eec

File tree

2 files changed

+21
-8
lines changed

2 files changed

+21
-8
lines changed

Source/iPhoneSimulator.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
BOOL alreadyPrintedData;
2323
BOOL retinaDevice;
2424
BOOL tallDevice;
25+
BOOL is64BitDevice;
2526
}
2627

2728
- (void)runWithArgc:(int)argc argv:(char **)argv;

Source/iPhoneSimulator.m

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,20 +93,20 @@ -(void) LoadSimulatorFramework:(NSString*) developerDir {
9393
NSString* developerDir = [env objectForKey:@"DEVELOPER_DIR"];
9494
if ([developerDir length] > 0)
9595
return developerDir;
96-
96+
9797
// Go look for it via xcode-select.
9898
NSTask* xcodeSelectTask = [[[NSTask alloc] init] autorelease];
9999
[xcodeSelectTask setLaunchPath:@"/usr/bin/xcode-select"];
100100
[xcodeSelectTask setArguments:[NSArray arrayWithObject:@"-print-path"]];
101-
101+
102102
NSPipe* outputPipe = [NSPipe pipe];
103103
[xcodeSelectTask setStandardOutput:outputPipe];
104104
NSFileHandle* outputFile = [outputPipe fileHandleForReading];
105-
105+
106106
[xcodeSelectTask launch];
107107
NSData* outputData = [outputFile readDataToEndOfFile];
108108
[xcodeSelectTask terminate];
109-
109+
110110
NSString* output =
111111
[[[NSString alloc] initWithData:outputData
112112
encoding:NSUTF8StringEncoding] autorelease];
@@ -135,6 +135,7 @@ - (void) printUsage {
135135
fprintf(stderr, " --family <device family> The device type that should be simulated (defaults to `iphone')\n");
136136
fprintf(stderr, " --retina Start a retina device\n");
137137
fprintf(stderr, " --tall In combination with --retina flag, start the tall version of the retina device (e.g. iPhone 5 (4-inch))\n");
138+
fprintf(stderr, " --64bit In combination with --retina flag and the --tall flag, start the 64bit version of the tall retina device (e.g. iPhone 5S (4-inch 64bit))\n");
138139
fprintf(stderr, " --uuid <uuid> A UUID identifying the session (is that correct?)\n");
139140
fprintf(stderr, " --env <environment file path> A plist file containing environment key-value pairs that should be set\n");
140141
fprintf(stderr, " --setenv NAME=VALUE Set an environment variable\n");
@@ -343,8 +344,8 @@ - (int)launchApp:(NSString *)path withFamily:(NSString *)family
343344
[config setSimulatedDeviceFamily:[NSNumber numberWithInt:1]];
344345
}
345346
}
346-
347-
NSString* devicePropertyValue = [self changeDeviceType:family retina:retinaDevice isTallDevice:tallDevice];
347+
348+
NSString* devicePropertyValue = [self changeDeviceType:family retina:retinaDevice isTallDevice:tallDevice is64Bit:is64BitDevice];
348349
[config setSimulatedDeviceInfoName:devicePropertyValue];
349350

350351
/* Start the session */
@@ -362,18 +363,26 @@ - (int)launchApp:(NSString *)path withFamily:(NSString *)family
362363
return EXIT_SUCCESS;
363364
}
364365

365-
- (NSString*) changeDeviceType:(NSString *)family retina:(BOOL)retina isTallDevice:(BOOL)isTallDevice {
366+
- (NSString*) changeDeviceType:(NSString *)family retina:(BOOL)retina isTallDevice:(BOOL)isTallDevice is64Bit:(BOOL)is64Bit {
366367
NSString *devicePropertyValue;
367368
if (retina) {
368369
if (verbose) {
369370
nsprintf(@"using retina");
370371
}
371372
if ([family isEqualToString:@"ipad"]) {
372-
devicePropertyValue = deviceIpadRetina;
373+
if (is64Bit) {
374+
devicePropertyValue = deviceIpadRetina_64bit;
375+
} else {
376+
devicePropertyValue = deviceIpadRetina;
377+
}
373378
}
374379
else {
375380
if (isTallDevice) {
381+
if (is64Bit) {
382+
devicePropertyValue = deviceIphoneRetina4_0Inch_64bit;
383+
} else {
376384
devicePropertyValue = deviceIphoneRetina4_0Inch;
385+
}
377386
} else {
378387
devicePropertyValue = deviceIphoneRetina3_5Inch;
379388
}
@@ -403,6 +412,7 @@ - (void)runWithArgc:(int)argc argv:(char **)argv {
403412

404413
retinaDevice = NO;
405414
tallDevice = NO;
415+
is64BitDevice = NO;
406416
exitOnStartup = NO;
407417
alreadyPrintedData = NO;
408418
startOnly = strcmp(argv[1], "start") == 0;
@@ -516,6 +526,8 @@ - (void)runWithArgc:(int)argc argv:(char **)argv {
516526
retinaDevice = YES;
517527
} else if (strcmp(argv[i], "--tall") == 0) {
518528
tallDevice = YES;
529+
} else if (strcmp(argv[i], "--64bit") == 0) {
530+
is64BitDevice = YES;
519531
} else if (strcmp(argv[i], "--args") == 0) {
520532
i++;
521533
break;

0 commit comments

Comments
 (0)