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 | 4 |
5 #import <Foundation/Foundation.h> | 5 #import <Foundation/Foundation.h> |
6 #include <asl.h> | 6 #include <asl.h> |
7 #include <libgen.h> | 7 #include <libgen.h> |
8 #include <stdarg.h> | 8 #include <stdarg.h> |
9 #include <stdio.h> | 9 #include <stdio.h> |
10 | 10 |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 exit(kExitInitializationFailure); | 170 exit(kExitInitializationFailure); |
171 } | 171 } |
172 return theClass; | 172 return theClass; |
173 } | 173 } |
174 | 174 |
175 // Prints supported devices and SDKs. | 175 // Prints supported devices and SDKs. |
176 void PrintSupportedDevices() { | 176 void PrintSupportedDevices() { |
177 // TODO(lliabraa): Once all builders are on Xcode 6 this ifdef can be removed | 177 // TODO(lliabraa): Once all builders are on Xcode 6 this ifdef can be removed |
178 // (crbug.com/385030). | 178 // (crbug.com/385030). |
179 #if defined(IOSSIM_USE_XCODE_6) | 179 #if defined(IOSSIM_USE_XCODE_6) |
180 printf("Retrieving supported devices:\n"); | 180 printf("Supported device/SDK combinations:\n"); |
181 Class simServiceConnectionManagerClass = | |
182 FindClassByName(@"SimServiceConnectionManager"); | |
183 [[simServiceConnectionManagerClass sharedConnectionManager] connect]; | |
184 | |
185 Class simDeviceSetClass = FindClassByName(@"SimDeviceSet"); | 181 Class simDeviceSetClass = FindClassByName(@"SimDeviceSet"); |
186 id deviceSet = | 182 id deviceSet = |
187 [simDeviceSetClass setForSetPath:[simDeviceSetClass defaultSetPath]]; | 183 [simDeviceSetClass setForSetPath:[simDeviceSetClass defaultSetPath]]; |
188 for (id simDevice in [deviceSet availableDevices]) { | 184 for (id simDevice in [deviceSet availableDevices]) { |
189 NSString* deviceInfo = | 185 NSString* deviceInfo = |
190 [NSString stringWithFormat:@" -d '%@' -s '%@'\n", | 186 [NSString stringWithFormat:@" -d '%@' -s '%@'\n", |
191 [simDevice name], [[simDevice runtime] versionString]]; | 187 [simDevice name], [[simDevice runtime] versionString]]; |
192 printf("%s", [deviceInfo UTF8String]); | 188 printf("%s", [deviceInfo UTF8String]); |
193 } | 189 } |
194 #else | 190 #else |
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
750 toolName = strdup(toolName); | 746 toolName = strdup(toolName); |
751 if (toolName != NULL) | 747 if (toolName != NULL) |
752 gToolName = toolName; | 748 gToolName = toolName; |
753 } | 749 } |
754 if (worker != NULL) | 750 if (worker != NULL) |
755 free(worker); | 751 free(worker); |
756 | 752 |
757 NSString* appPath = nil; | 753 NSString* appPath = nil; |
758 NSString* appName = nil; | 754 NSString* appName = nil; |
759 NSString* sdkVersion = nil; | 755 NSString* sdkVersion = nil; |
| 756 // TODO(lliabraa): Once all builders are on Xcode 6 this ifdef can be removed |
| 757 // (crbug.com/385030). |
| 758 #if defined(IOSSIM_USE_XCODE_6) |
| 759 NSString* deviceName = @"iPhone 5"; |
| 760 #else |
760 NSString* deviceName = @"iPhone"; | 761 NSString* deviceName = @"iPhone"; |
| 762 #endif |
761 NSString* simHomePath = nil; | 763 NSString* simHomePath = nil; |
762 NSMutableArray* appArgs = [NSMutableArray array]; | 764 NSMutableArray* appArgs = [NSMutableArray array]; |
763 NSMutableDictionary* appEnv = [NSMutableDictionary dictionary]; | 765 NSMutableDictionary* appEnv = [NSMutableDictionary dictionary]; |
764 NSTimeInterval sessionStartTimeout = kDefaultSessionStartTimeoutSeconds; | 766 NSTimeInterval sessionStartTimeout = kDefaultSessionStartTimeoutSeconds; |
765 | 767 |
766 NSString* developerDir = FindDeveloperDir(); | 768 NSString* developerDir = FindDeveloperDir(); |
767 if (!developerDir) { | 769 if (!developerDir) { |
768 LogError(@"Unable to find developer directory."); | 770 LogError(@"Unable to find developer directory."); |
769 exit(kExitInitializationFailure); | 771 exit(kExitInitializationFailure); |
770 } | 772 } |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
927 [error localizedDescription], | 929 [error localizedDescription], |
928 [error domain], static_cast<long int>([error code])); | 930 [error domain], static_cast<long int>([error code])); |
929 } | 931 } |
930 | 932 |
931 // Note that this code is only executed if the simulator fails to start | 933 // Note that this code is only executed if the simulator fails to start |
932 // because once the main run loop is started, only the delegate calling | 934 // because once the main run loop is started, only the delegate calling |
933 // exit() will end the program. | 935 // exit() will end the program. |
934 [pool drain]; | 936 [pool drain]; |
935 return kExitFailure; | 937 return kExitFailure; |
936 } | 938 } |
OLD | NEW |