Skip to content

Commit 4b663b4

Browse files
author
Chris Wilson
committed
Adds more detail to simulator names so it is easier to find version of simulator that you are looking for.
1 parent 9662fa2 commit 4b663b4

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

CoreDataUtil/SimulatorItem.m

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,21 @@ - (NSString*) label {
273273
break;
274274
}
275275
case MFLSimulatorItem: {
276-
return [self.simInfo valueForKey:@"name"];
276+
NSString* name = [self.simInfo valueForKey:@"name"];
277+
NSString* runTime = [self.simInfo valueForKey:@"runtime"];
278+
if (runTime == nil || runTime.length == 0) {
279+
runTime = @"unknown";
280+
} else {
281+
runTime = [[runTime componentsSeparatedByString:@"."] lastObject];
282+
runTime = [runTime stringByReplacingOccurrencesOfString:@"-" withString:@"."];
283+
}
284+
285+
NSString* label = [NSString stringWithFormat:@"%@ (%@)", name, runTime];
286+
if ([[self children] count] > 0) {
287+
label = [NSString stringWithFormat:@"%@ - %ld %@", label, [[self children] count], [[self children] count] == 1 ? @"app" : @"apps"];
288+
}
289+
290+
return label; //[self.simInfo valueForKey:@"name"];
277291
break;
278292
}
279293
case MFLAppItem: {

0 commit comments

Comments
 (0)