diff options
author | justincohen <justincohen@chromium.org> | 2015-06-17 13:23:41 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-06-17 20:24:13 +0000 |
commit | 86ae0436336747384292248d16f7524840e8b5d0 (patch) | |
tree | dd2fcea0a96a01beef0b5ca550796183dc3d4740 /testing/iossim | |
parent | b865eb88a8e8834ca0f5c6e9e55288bf43e5d92b (diff) | |
download | chromium_src-86ae0436336747384292248d16f7524840e8b5d0.zip chromium_src-86ae0436336747384292248d16f7524840e8b5d0.tar.gz chromium_src-86ae0436336747384292248d16f7524840e8b5d0.tar.bz2 |
Fix iossim on latest Xcode beta.
Stop using -supportedDeviceTypesByName, instead use
-supportedDeviceTypesByAlias.
Ensure -BuildSystemRoot chooses the most recent SDK if no
default SDK is chosen.
Also upstream nullability change common.gypi.
BUG=499779
Review URL: https://codereview.chromium.org/1182493010
Cr-Commit-Position: refs/heads/master@{#334904}
Diffstat (limited to 'testing/iossim')
-rw-r--r-- | testing/iossim/iossim.mm | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/testing/iossim/iossim.mm b/testing/iossim/iossim.mm index 933a183..4d557ac8 100644 --- a/testing/iossim/iossim.mm +++ b/testing/iossim/iossim.mm @@ -632,7 +632,18 @@ DTiPhoneSimulatorApplicationSpecifier* BuildAppSpec(NSString* appPath) { // valid. DTiPhoneSimulatorSystemRoot* BuildSystemRoot(NSString* sdkVersion) { Class systemRootClass = FindClassByName(@"DTiPhoneSimulatorSystemRoot"); +#if defined(IOSSIM_USE_XCODE_6) + Class simRuntimeClass = FindClassByName(@"SimRuntime"); + NSArray* sorted = + [[simRuntimeClass supportedRuntimes] sortedArrayUsingDescriptors:@[ + [NSSortDescriptor sortDescriptorWithKey:@"version" ascending:YES] + ]]; + NSString* versionString = [[sorted lastObject] versionString]; + DTiPhoneSimulatorSystemRoot* systemRoot = + [systemRootClass rootWithSDKVersion:versionString]; +#else DTiPhoneSimulatorSystemRoot* systemRoot = [systemRootClass defaultRoot]; +#endif if (sdkVersion) systemRoot = [systemRootClass rootWithSDKVersion:sdkVersion]; @@ -666,7 +677,7 @@ DTiPhoneSimulatorSessionConfig* BuildSessionConfig( #if defined(IOSSIM_USE_XCODE_6) Class simDeviceTypeClass = FindClassByName(@"SimDeviceType"); id simDeviceType = - [simDeviceTypeClass supportedDeviceTypesByName][deviceName]; + [simDeviceTypeClass supportedDeviceTypesByAlias][deviceName]; Class simRuntimeClass = FindClassByName(@"SimRuntime"); NSString* identifier = systemRoot.runtime.identifier; id simRuntime = [simRuntimeClass supportedRuntimesByIdentifier][identifier]; @@ -956,7 +967,7 @@ int main(int argc, char* const argv[]) { if (IsRunningWithXcode6OrLater()) { #if defined(IOSSIM_USE_XCODE_6) Class simDeviceTypeClass = FindClassByName(@"SimDeviceType"); - if ([simDeviceTypeClass supportedDeviceTypesByName][deviceName] == nil) { + if ([simDeviceTypeClass supportedDeviceTypesByAlias][deviceName] == nil) { LogError(@"Invalid device name: %@.", deviceName); PrintSupportedDevices(); exit(kExitInvalidArguments); |