| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 #import <Foundation/Foundation.h> | 4 #import <Foundation/Foundation.h> |
| 5 #include <getopt.h> | 5 #include <getopt.h> |
| 6 #include <string> | 6 #include <string> |
| 7 | 7 |
| 8 namespace { | 8 namespace { |
| 9 | 9 |
| 10 void PrintUsage() { | 10 void PrintUsage() { |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 case 'p': | 352 case 'p': |
| 353 wants_print_home = true; | 353 wants_print_home = true; |
| 354 break; | 354 break; |
| 355 case 'l': | 355 case 'l': |
| 356 PrintSupportedDevices(simctl_list); | 356 PrintSupportedDevices(simctl_list); |
| 357 exit(kExitSuccess); | 357 exit(kExitSuccess); |
| 358 break; | 358 break; |
| 359 case 'h': | 359 case 'h': |
| 360 PrintUsage(); | 360 PrintUsage(); |
| 361 exit(kExitSuccess); | 361 exit(kExitSuccess); |
| 362 case 'u': | |
| 363 case 't': | |
| 364 // Ignore 'u' and 't', used by old version of iossim. | |
| 365 break; | 362 break; |
| 366 default: | 363 default: |
| 367 PrintUsage(); | 364 PrintUsage(); |
| 368 exit(kExitInvalidArguments); | 365 exit(kExitInvalidArguments); |
| 369 } | 366 } |
| 370 } | 367 } |
| 371 | 368 |
| 372 NSString* udid = GetDeviceBySDKAndName(simctl_list, device_name, sdk_version); | 369 NSString* udid = GetDeviceBySDKAndName(simctl_list, device_name, sdk_version); |
| 373 if (udid == nil) { | 370 if (udid == nil) { |
| 374 LogError(@"Unable to find a device %@ with SDK %@.", device_name, | 371 LogError(@"Unable to find a device %@ with SDK %@.", device_name, |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 } else { | 411 } else { |
| 415 LogError(@"Unable to parse command line arguments."); | 412 LogError(@"Unable to parse command line arguments."); |
| 416 PrintUsage(); | 413 PrintUsage(); |
| 417 exit(kExitInvalidArguments); | 414 exit(kExitInvalidArguments); |
| 418 } | 415 } |
| 419 | 416 |
| 420 RunApplication(app_path, xctest_path, udid, app_env, cmd_args); | 417 RunApplication(app_path, xctest_path, udid, app_env, cmd_args); |
| 421 KillSimulator(); | 418 KillSimulator(); |
| 422 return kExitSuccess; | 419 return kExitSuccess; |
| 423 } | 420 } |
| OLD | NEW |