Deleting an app from the simulator does not clear its NSUserDefault values

Originator:john.lawson
Number:rdar://18649158 Date Originated:10/14/2014
Status:Open Resolved:
Product:Xcode Product Version:6.0.1
Classification:Developer Tools Reproducible:Yes
 
Summary:
When developing, we build and run constantly, and some of the settings that are set during first run are part of the tests, which prior to Xcode 6, one could just remove the app from the simulator (similar to how a user deletes an app from their device) and the app's data would be removed along with it.

The problem is that now in Xcode 6, doing the above, does not remove an app's data, and when we constantly have to reset the simulator it's an extra step that resets other settings a user might not want to reset (like social account logins).

Steps to Reproduce:
1. Create a single view application iOS application
2. In the xib or storyboard for the view controller, create a simple button that when pressed, updates a value in the NSUserDefault standardUserDefaults dictionary, and then displays the value in a label that is visible in the said view controller's view.
3. When you relaunch the app, the label should automatically display the value from the user dictionary.
4. stop running the app, delete the app from simulator via long-press flow
5. build and run the application again
6. see value is displayed in label without having pressed the button

Expected Results:
The label value should be empty (or display "(null)" depending on how you coded it).

Actual Results:
6. see value is displayed in label without having pressed the button

Version:
Xcode Version 6.0.1 (6A317)
OS X 10.9.5 (13F34)

Notes:


Configuration:


Attachments:

Comments


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!