Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone - Where is the [NSUserDefaults standardUserDefaults] file stored on the computer?

When running an app on the iPhone (for example when you can do it in another way testing some GPS or camera feature), where can I find and check the file created by NSUserDefaults to save the standardUserDefaults ? I'm running XCode 4.

like image 923
Oliver Avatar asked Mar 23 '11 10:03

Oliver


People also ask

Where NSUserDefaults data is saved?

The user's defaults database is stored on disk as a property list or plist. A property list or plist is an XML file. At runtime, the UserDefaults class keeps the contents of the property list in memory to improve performance. Changes are made synchronously within the process of your application.

What is NSUserDefaults in IOS?

Overview. The NSUserDefaults class provides a programmatic interface for interacting with the defaults system. The defaults system allows an app to customize its behavior to match a user's preferences. For example, you can allow users to specify their preferred units of measurement or media playback speed.


2 Answers

It's in your app directory under:

Library -> Preferences -> bundleID.plist

You can access the data on your device. Go into the organizer select your device then the app and there should be a download button there. If you click that it will download all the app data.

like image 166
rckoenes Avatar answered Oct 19 '22 23:10

rckoenes


The user defaults file for applications started in the simulator are located here:

/Users/[USERNAME]/Library/Application Support/iPhone Simulator/4.3/Applications/[UNIQUE IDENTIFIER]/Library/Preferences/APP_ID.plist

The USERNAME is the user you run as on your system.

The UNIQUE IDENTIFIER is generated by Xcode.

APP_ID is your com.yourcompany.app bundle id.

like image 27
clawoo Avatar answered Oct 20 '22 00:10

clawoo