summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--testing/iossim/iossim.mm11
1 files changed, 5 insertions, 6 deletions
diff --git a/testing/iossim/iossim.mm b/testing/iossim/iossim.mm
index 7d5dbf8..ac03dcd 100644
--- a/testing/iossim/iossim.mm
+++ b/testing/iossim/iossim.mm
@@ -491,12 +491,11 @@ BOOL InitializeSimulatorUserHome(NSString* userHomePath, NSString* deviceName) {
// Set the device to simulate. Note that the iOS Simulator must not be running
// for this setting to take effect.
- NSMutableDictionary* plistDict =
- [NSMutableDictionary dictionaryWithObject:deviceName
- forKey:@"SimulateDevice"];
- NSString* plistPath = @"Library/Preferences/com.apple.iphonesimulator.plist";
- [plistDict writeToFile:[userHomePath stringByAppendingPathComponent:plistPath]
- atomically:YES];
+ CFStringRef iPhoneSimulatorAppID = CFSTR("com.apple.iphonesimulator");
+ CFPreferencesSetAppValue(CFSTR("SimulateDevice"),
+ deviceName,
+ iPhoneSimulatorAppID);
+ CFPreferencesAppSynchronize(iPhoneSimulatorAppID);
// Update the environment to use the specified directory as the user home
// directory.