Skip to content

Commit 4308489

Browse files
committed
Fixes #132 - Add --no-deprecations flag for those that don't want the stdout noise
1 parent 795d949 commit 4308489

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ Options:
5454
--args <...> All following arguments will be passed on to the application
5555
--devicetypeid <device type> The id of the device type that should be simulated (Xcode6+). Use 'showdevicetypes' to list devices.
5656
e.g "com.apple.CoreSimulator.SimDeviceType.Resizable-iPhone6, 8.0"
57+
--no-deprecations Suppress deprecation notices.
58+
5759
DEPRECATED in 3.x, use devicetypeid instead:
5860
--sdk <sdkversion> The iOS SDK version to run the application on (defaults to the latest)
5961
--family <device family> The device type that should be simulated (defaults to `iphone')

Source/iPhoneSimulator.h

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
BOOL retinaDevice;
2424
BOOL tallDevice;
2525
BOOL is64BitDevice;
26+
BOOL noDeprecations;
2627
NSString *deviceTypeId;
2728
}
2829

Source/iPhoneSimulator.m

+8-1
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,8 @@ - (void) printUsage {
200200
fprintf(stderr, " --args <...> All following arguments will be passed on to the application\n");
201201
fprintf(stderr, " --devicetypeid <device type> The id of the device type that should be simulated (Xcode6+). Use 'showdevicetypes' to list devices.\n");
202202
fprintf(stderr, " e.g \"com.apple.CoreSimulator.SimDeviceType.Resizable-iPhone6, 8.0\"\n");
203+
fprintf(stderr, " --no-deprecations Suppress deprecation notices.\n");
204+
fprintf(stderr, "\n");
203205
fprintf(stderr, "DEPRECATED in 3.x, use devicetypeid instead:\n");
204206
fprintf(stderr, " --sdk <sdkversion> The iOS SDK version to run the application on (defaults to the latest)\n");
205207
fprintf(stderr, " --family <device family> The device type that should be simulated (defaults to `iphone')\n");
@@ -209,7 +211,9 @@ - (void) printUsage {
209211
}
210212

211213
- (void) printDeprecation:(char*)option {
212-
fprintf(stderr, "Usage of '%s' is deprecated in 3.x. Use --devicetypeid instead.\n", option);
214+
if (!noDeprecations) {
215+
fprintf(stderr, "Usage of '%s' is deprecated in 3.x. Use --devicetypeid instead.\n", option);
216+
}
213217
}
214218

215219

@@ -611,6 +615,7 @@ - (void)runWithArgc:(int)argc argv:(char **)argv {
611615
alreadyPrintedData = NO;
612616
startOnly = strcmp(argv[1], "start") == 0;
613617
deviceTypeId = nil;
618+
noDeprecations = NO;
614619

615620
NSString* developerDir = FindDeveloperDir();
616621
if (!developerDir) {
@@ -661,6 +666,8 @@ - (void)runWithArgc:(int)argc argv:(char **)argv {
661666
verbose = YES;
662667
} else if (strcmp(argv[i], "--exit") == 0) {
663668
exitOnStartup = YES;
669+
} else if (strcmp(argv[i], "--no-deprecations") == 0) {
670+
noDeprecations = YES;
664671
} else if (strcmp(argv[i], "--debug") == 0) {
665672
shouldStartDebugger = YES;
666673
} else if (strcmp(argv[i], "--use-gdb") == 0) {

0 commit comments

Comments
 (0)