Skip to content

Commit 4633fae

Browse files
committed
Fixes #114 - Deprecate options, superceded by --devicetypeid parameter
1 parent ae1b289 commit 4633fae

File tree

5 files changed

+47
-27
lines changed

5 files changed

+47
-27
lines changed

README.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
ios-sim
22
=======
33

4+
Supports Xcode 6 only since version 3.x.
5+
46
The ios-sim tool is a command-line utility that launches an iOS application on
57
the iOS Simulator. This allows for niceties such as automated testing without
6-
having to open XCode.
8+
having to open Xcode.
79

810
Features
911
--------
1012

11-
* Choose the device family to simulate, i.e. iPhone or iPad.
13+
* Choose the device family to simulate, i.e. iPhone or iPad. Run using "showdevicetypes" option to see available device types, and pass it in as the "devicetypeid" parameter.
1214
* Setup environment variables.
1315
* Pass arguments to the application.
1416
* See the stdout and stderr, or redirect them to files.
@@ -34,19 +36,21 @@ Options:
3436
--exit Exit after startup
3537
--debug Attach LLDB to the application on startup
3638
--use-gdb Use GDB instead of LLDB. (Requires --debug)
37-
--sdk <sdkversion> The iOS SDK version to run the application on (defaults to the latest)
38-
--devicetypeid <device type> The id of the device type that should be simulated (Xcode6+)
39-
--family <device family> The device type that should be simulated (defaults to `iphone')
40-
--retina Start a retina device
41-
--tall In combination with --retina flag, start the tall version of the retina device (e.g. iPhone 5 (4-inch))
42-
--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))
4339
--uuid <uuid> A UUID identifying the session (is that correct?)
4440
--env <environment file path> A plist file containing environment key-value pairs that should be set
4541
--setenv NAME=VALUE Set an environment variable
4642
--stdout <stdout file path> The path where stdout of the simulator will be redirected to (defaults to stdout of ios-sim)
4743
--stderr <stderr file path> The path where stderr of the simulator will be redirected to (defaults to stderr of ios-sim)
4844
--timeout <seconds> The timeout time to wait for a response from the Simulator. Default value: 30 seconds
4945
--args <...> All following arguments will be passed on to the application
46+
--devicetypeid <device type> The id of the device type that should be simulated (Xcode6+). Use 'showdevicetypes' to list devices.
47+
e.g "com.apple.CoreSimulator.SimDeviceType.Resizable-iPhone6, 8.0"
48+
DEPRECATED in 3.x, use devicetypeid instead:
49+
--sdk <sdkversion> The iOS SDK version to run the application on (defaults to the latest)
50+
--family <device family> The device type that should be simulated (defaults to `iphone')
51+
--retina Start a retina device
52+
--tall In combination with --retina flag, start the tall version of the retina device (e.g. iPhone 5 (4-inch))
53+
--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))
5054
```
5155

5256
Installation

README.template.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
ios-sim
22
=======
33

4+
Supports Xcode 6 only since version 3.x.
5+
46
The ios-sim tool is a command-line utility that launches an iOS application on
57
the iOS Simulator. This allows for niceties such as automated testing without
6-
having to open XCode.
8+
having to open Xcode.
79

810
Features
911
--------
1012

11-
* Choose the device family to simulate, i.e. iPhone or iPad.
13+
* Choose the device family to simulate, i.e. iPhone or iPad. Run using "showdevicetypes" option to see available device types, and pass it in as the "devicetypeid" parameter.
1214
* Setup environment variables.
1315
* Pass arguments to the application.
1416
* See the stdout and stderr, or redirect them to files.
@@ -34,19 +36,21 @@ Options:
3436
--exit Exit after startup
3537
--debug Attach LLDB to the application on startup
3638
--use-gdb Use GDB instead of LLDB. (Requires --debug)
37-
--sdk <sdkversion> The iOS SDK version to run the application on (defaults to the latest)
38-
--devicetypeid <device type> The id of the device type that should be simulated (Xcode6+)
39-
--family <device family> The device type that should be simulated (defaults to `iphone')
40-
--retina Start a retina device
41-
--tall In combination with --retina flag, start the tall version of the retina device (e.g. iPhone 5 (4-inch))
42-
--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))
4339
--uuid <uuid> A UUID identifying the session (is that correct?)
4440
--env <environment file path> A plist file containing environment key-value pairs that should be set
4541
--setenv NAME=VALUE Set an environment variable
4642
--stdout <stdout file path> The path where stdout of the simulator will be redirected to (defaults to stdout of ios-sim)
4743
--stderr <stderr file path> The path where stderr of the simulator will be redirected to (defaults to stderr of ios-sim)
4844
--timeout <seconds> The timeout time to wait for a response from the Simulator. Default value: 30 seconds
4945
--args <...> All following arguments will be passed on to the application
46+
--devicetypeid <device type> The id of the device type that should be simulated (Xcode6+). Use 'showdevicetypes' to list devices.
47+
e.g "com.apple.CoreSimulator.SimDeviceType.Resizable-iPhone6, 8.0"
48+
DEPRECATED in 3.x, use devicetypeid instead:
49+
--sdk <sdkversion> The iOS SDK version to run the application on (defaults to the latest)
50+
--family <device family> The device type that should be simulated (defaults to `iphone')
51+
--retina Start a retina device
52+
--tall In combination with --retina flag, start the tall version of the retina device (e.g. iPhone 5 (4-inch))
53+
--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))
5054
```
5155

5256
Installation

Source/iPhoneSimulator.m

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
NSString* deviceTypeIdIphone4s = @"com.apple.CoreSimulator.SimDeviceType.iPhone-4s";
2626
NSString* deviceTypeIdIphone5 = @"com.apple.CoreSimulator.SimDeviceType.iPhone-5";
2727
NSString* deviceTypeIdIphone5s = @"com.apple.CoreSimulator.SimDeviceType.iPhone-5s";
28+
NSString* deviceTypeIdIphone6 = @"com.apple.CoreSimulator.SimDeviceType.iPhone-6";
29+
NSString* deviceTypeIdIphone6Plus = @"com.apple.CoreSimulator.SimDeviceType.iPhone-6-Plus";
2830
NSString* deviceTypeIdIpad2 = @"com.apple.CoreSimulator.SimDeviceType.iPad-2";
2931
NSString* deviceTypeIdIpadRetina = @"com.apple.CoreSimulator.SimDeviceType.iPad-Retina";
3032
NSString* deviceTypeIdIpadAir = @"com.apple.CoreSimulator.SimDeviceType.iPad-Air";
@@ -139,6 +141,7 @@ -(void) LoadSimulatorFramework:(NSString*) developerDir {
139141
output = nil;
140142
return output;
141143
}
144+
142145
- (void) printUsage {
143146
fprintf(stderr, "Usage: ios-sim <command> <options> [--args ...]\n");
144147
fprintf(stderr, "\n");
@@ -155,19 +158,25 @@ - (void) printUsage {
155158
fprintf(stderr, " --exit Exit after startup\n");
156159
fprintf(stderr, " --debug Attach LLDB to the application on startup\n");
157160
fprintf(stderr, " --use-gdb Use GDB instead of LLDB. (Requires --debug)\n");
158-
fprintf(stderr, " --sdk <sdkversion> The iOS SDK version to run the application on (defaults to the latest)\n");
159-
fprintf(stderr, " --devicetypeid <device type> The id of the device type that should be simulated (Xcode6+)\n");
160-
fprintf(stderr, " --family <device family> The device type that should be simulated (defaults to `iphone')\n");
161-
fprintf(stderr, " --retina Start a retina device\n");
162-
fprintf(stderr, " --tall In combination with --retina flag, start the tall version of the retina device (e.g. iPhone 5 (4-inch))\n");
163-
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");
164161
fprintf(stderr, " --uuid <uuid> A UUID identifying the session (is that correct?)\n");
165162
fprintf(stderr, " --env <environment file path> A plist file containing environment key-value pairs that should be set\n");
166163
fprintf(stderr, " --setenv NAME=VALUE Set an environment variable\n");
167164
fprintf(stderr, " --stdout <stdout file path> The path where stdout of the simulator will be redirected to (defaults to stdout of ios-sim)\n");
168165
fprintf(stderr, " --stderr <stderr file path> The path where stderr of the simulator will be redirected to (defaults to stderr of ios-sim)\n");
169166
fprintf(stderr, " --timeout <seconds> The timeout time to wait for a response from the Simulator. Default value: 30 seconds\n");
170167
fprintf(stderr, " --args <...> All following arguments will be passed on to the application\n");
168+
fprintf(stderr, " --devicetypeid <device type> The id of the device type that should be simulated (Xcode6+). Use 'showdevicetypes' to list devices.\n");
169+
fprintf(stderr, " e.g \"com.apple.CoreSimulator.SimDeviceType.Resizable-iPhone6, 8.0\"\n");
170+
fprintf(stderr, "DEPRECATED in 3.x, use devicetypeid instead:\n");
171+
fprintf(stderr, " --sdk <sdkversion> The iOS SDK version to run the application on (defaults to the latest)\n");
172+
fprintf(stderr, " --family <device family> The device type that should be simulated (defaults to `iphone')\n");
173+
fprintf(stderr, " --retina Start a retina device\n");
174+
fprintf(stderr, " --tall In combination with --retina flag, start the tall version of the retina device (e.g. iPhone 5 (4-inch))\n");
175+
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");
176+
}
177+
178+
- (void) printDeprecation:(char*)option {
179+
fprintf(stderr, "Usage of '%s' is deprecated in 3.x. Use --devicetypeid instead.\n", option);
171180
}
172181

173182

@@ -597,6 +606,7 @@ - (void)runWithArgc:(int)argc argv:(char **)argv {
597606
}
598607
}
599608
else if (strcmp(argv[i], "--sdk") == 0) {
609+
[self printDeprecation:argv[i]];
600610
i++;
601611
[self LoadSimulatorFramework:developerDir];
602612
NSString* ver = [NSString stringWithCString:argv[i] encoding:NSUTF8StringEncoding];
@@ -615,6 +625,7 @@ - (void)runWithArgc:(int)argc argv:(char **)argv {
615625
exit(EXIT_FAILURE);
616626
}
617627
} else if (strcmp(argv[i], "--family") == 0) {
628+
[self printDeprecation:argv[i]];
618629
i++;
619630
family = [NSString stringWithUTF8String:argv[i]];
620631
} else if (strcmp(argv[i], "--uuid") == 0) {
@@ -649,10 +660,13 @@ - (void)runWithArgc:(int)argc argv:(char **)argv {
649660
xctest = [[NSString stringWithUTF8String:argv[i]] expandPath];
650661
NSLog(@"xctest: %@", xctest);
651662
} else if (strcmp(argv[i], "--retina") == 0) {
663+
[self printDeprecation:argv[i]];
652664
retinaDevice = YES;
653665
} else if (strcmp(argv[i], "--tall") == 0) {
666+
[self printDeprecation:argv[i]];
654667
tallDevice = YES;
655668
} else if (strcmp(argv[i], "--64bit") == 0) {
669+
[self printDeprecation:argv[i]];
656670
is64BitDevice = YES;
657671
} else if (strcmp(argv[i], "--args") == 0) {
658672
i++;

ios-sim.xcodeproj/project.pbxproj

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121
08FB7793FE84155DC02AAC07 /* Project object */ = {
122122
isa = PBXProject;
123123
attributes = {
124-
LastUpgradeCheck = 0440;
124+
LastUpgradeCheck = 0600;
125125
};
126126
buildConfigurationList = 1DEB927808733DD40010E9CD /* Build configuration list for PBXProject "ios-sim" */;
127127
compatibilityVersion = "Xcode 3.2";
@@ -192,13 +192,12 @@
192192
1DEB927908733DD40010E9CD /* Debug */ = {
193193
isa = XCBuildConfiguration;
194194
buildSettings = {
195-
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
196195
GCC_C_LANGUAGE_STANDARD = gnu99;
197196
GCC_OPTIMIZATION_LEVEL = 0;
198197
GCC_WARN_ABOUT_RETURN_TYPE = YES;
199198
GCC_WARN_UNUSED_VARIABLE = YES;
200199
HEADER_SEARCH_PATHS = .;
201-
ONLY_ACTIVE_ARCH = NO;
200+
ONLY_ACTIVE_ARCH = YES;
202201
SDKROOT = macosx;
203202
VALID_ARCHS = "i386 x86_64";
204203
};
@@ -207,7 +206,6 @@
207206
1DEB927A08733DD40010E9CD /* Release */ = {
208207
isa = XCBuildConfiguration;
209208
buildSettings = {
210-
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
211209
GCC_C_LANGUAGE_STANDARD = gnu99;
212210
GCC_WARN_ABOUT_RETURN_TYPE = YES;
213211
GCC_WARN_UNUSED_VARIABLE = YES;

ios-sim.xcodeproj/xcshareddata/xcschemes/ios-sim.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0510"
3+
LastUpgradeVersion = "0600"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

0 commit comments

Comments
 (0)