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.
-
1Who says it's in a file? And why does it matter? There's an API to access the values. How it's implemented should make no difference. – Stephen Darlington Mar 23 '11 at 10:32
-
3@Stephen Darlington : It's for easier debug and to see what is really recorded regarding to the original plist given. – Oliver Mar 23 '11 at 11:26
-
This will give you the location in Swift 3.1: print(NSHomeDirectory()) – Bobby Jun 01 '17 at 10:18
3 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.

- 7,982
- 6
- 45
- 71

- 69,092
- 8
- 134
- 166
-
+1 @rckoenes: Can you provide some more information. I didn't find in my system. – SNR Mar 23 '11 at 11:06
-
I don't find this folder in my app directory. For information, I run XCode 4. – Oliver Mar 23 '11 at 11:26
-
The has nothing to do with XCode 4. See the answer provided by Clawoo – rckoenes Mar 23 '11 at 12:14
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.

- 791
- 6
- 14
-
-
Yes I did, but since you can't access the application bundle from your device from your Mac, I gave you a solution for the Simulator. I suppose you could try to read the contents of the plist from your device using [NSDictionary dictionaryWithContentsOfFile:] and figuring out the path to the Library/Preferences/APP_ID.plist file. – clawoo Mar 23 '11 at 12:28
-
4You can access the data ion your device. Go into the organizer selected te your device then the app and there should be a download button there. If you click that it will download all the app data. – rckoenes Mar 23 '11 at 13:01
-
@rckoenes : rckoenes, you Rockkkk !Coudl you please post your comment as an answer as I could accept it ? – Oliver Mar 23 '11 at 23:59
You can see it in:
/var/mobile/Containers/Data/Application/F27682C5-55AC-4984-9864-313DA609134F/Library/Preferences while App at: /var/mobile/Containers/Bundle/Application/AE02FFCA-4CAF-4B58-8F32-0D67A78BD259

- 7,982
- 6
- 45
- 71

- 311
- 2
- 7