Index: testing/iossim/iossim.mm |
diff --git a/testing/iossim/iossim.mm b/testing/iossim/iossim.mm |
index 7d5dbf872e93cbc9c7e1155fefdbef3cd9caef07..954f0784060e8b947e634bad2bd50aac03a1f292 100644 |
--- a/testing/iossim/iossim.mm |
+++ b/testing/iossim/iossim.mm |
@@ -491,12 +491,13 @@ 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]; |
+ // Set the device to simulate. Note that the iOS Simulator must not be running |
+ // for this setting to take effect. |
TVL
2013/04/16 20:05:45
duplicate comment?
lliabraa
2013/04/17 13:15:37
Done.
TVL
2013/04/17 13:42:04
New upload?
|
+ 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. |