UIApplication preferencesValueForKey and setPreferencesValueForKey do not work iOS 8 Xcode 6 Instruments 6

Originator:joshuajmoody
Number:rdar://17821465 Date Originated:26-Jul-2014 10:38 PM
Status:Closed Resolved:
Product:Instruments Product Version:6.0
Classification:Bug Reproducible:Always
 
Summary:
I am trying to set and retrieve a value from the [NSUserDefaults standardUserDefaults] using UIAutomation javascript API.

Steps to Reproduce:
1. in Instruments 6.0, open a new Automation template
2. target an application that is running on an iOS 8 device
3. enter the following script:

var target = UIATarget.localTarget();

target.frontMostApp().setPreferencesValueForKey("value", "com.my.key")

var myValue  = target.frontMostApp().preferencesValueForKey("com.my.key")
UIALogger.logPass("myValue: ".concat(myValue));

4. run

Expected Results:
Expected:

* to see the [NSUserDefaults standardDefaults] to contain "com.my.key" => "value"
* to see "myValue: value" in the Automation log

Actual Results:
Found:

*  [NSUserDefaults standardDefaults] did not contain the key value pair
*  in the Automation log, "myValue: null"

Version:
* OS X 10.9.4 (13E28)
* OS X 10.10 (14A298i)

Xcode6-Beta4
Instruments 6.0 (56127.2)

$ xcrun xcodebuild -version
Xcode 6.0
Build version 6A267n

Notes:

Configuration:
Regression

The same steps yield in the expected results for Xcode 5.1.1 on iOS 6.0 - 7.1.

Attachments:

Comments

Duplicate 15530604 (Open)

By joshuajmoody at July 31, 2014, 12:25 p.m. (reply...)

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!