16

I am able to store, retrieve, and remove values using NSUserDefaults. I couldn't succeed to find out where NSUserDefaults getting stored physically on iPhone? I guess it should be plist file but not sure. Does anyone know if its possible to see this values on iPhone physically?

Thanks.

Paresh Masani
  • 7,474
  • 12
  • 73
  • 139

4 Answers4

32
  • Connect Your device to Xcode.
  • Select Windows -> Organiser.
  • Select your device.
  • Click on your application.
  • Click the gear icon and Download Container….
  • Select the downloaded .xcappdata file, right click and select Show Package Contents.
  • Open the AppData folder.
  • Navigate to Library -> Preferences -> appbundlename.plist.
Alex Zavatone
  • 4,106
  • 36
  • 54
Dileep Reghu
  • 879
  • 7
  • 6
8

The physical path is rootOfApplication/Library/Preferences/com.yourcompany.appName.plist you can see there if you test it in simulator

Rahul Vyas
  • 28,260
  • 49
  • 182
  • 256
0

I use SimSim. It's a free menu bar app that gives you access to all simulator folders. There are other solutions, but this is a basic tool I use all the time. https://github.com/dsmelov/simsim

SmileBot
  • 19,393
  • 7
  • 65
  • 62
0

Small differences to the accepted answer for Xcode 14.

  • Connect Your device to Xcode.
  • Select Window -> Devices and Simulators.
  • Select the Devices tab in the sidebar.
  • Select your device.
  • Select your application from the INSTALLED APPS section.
  • Click the encircled ellipsis icon and select Download Container… and Save the file.
  • In the Finder select the downloaded .xcappdata file, right click and select Show Package Contents.
  • The plist file is in the package's Appdata -> Preferencers -> Library.
Brian Redman
  • 438
  • 4
  • 10