iPhone:NSUserDefaults 存储在哪里?
我能够使用 NSUserDefaults 存储、检索和删除值。我无法成功找到 NSUserDefaults 在 iPhone 上的物理存储位置?我猜它应该是 plist 文件,但不确定。有谁知道是否可以在 iPhone 上实际看到这个值?
谢谢。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
Windows
->组织者
。下载容器...
。.xcappdata
文件,右键单击并选择显示包内容
。AppData
文件夹。Library
->首选项
->appbundlename.plist
。Windows
->Organiser
.Download Container…
..xcappdata
file, right click and selectShow Package Contents
.AppData
folder.Library
->Preferences
->appbundlename.plist
.物理路径是 rootOfApplication/Library/Preferences/com.yourcompany.appName.plist 如果您在模拟器中测试它,您可以看到那里
The physical path is rootOfApplication/Library/Preferences/com.yourcompany.appName.plist you can see there if you test it in simulator
我用的是SimSim。它是一个免费的菜单栏应用程序,可让您访问所有模拟器文件夹。还有其他解决方案,但这是我一直使用的基本工具。 https://github.com/dsmelov/simsim
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
与 Xcode 14 接受的答案略有不同。
窗口
->设备和模拟器
。设备
选项卡。已安装的应用程序
部分选择您的应用程序。下载容器...
并保存
文件。Finder
中选择下载的.xcappdata
文件,右键单击并选择显示包内容
。Appdata
->偏好设置
->图书馆
。Small differences to the accepted answer for Xcode 14.
Window
->Devices and Simulators
.Devices
tab in the sidebar.INSTALLED APPS
section.Download Container…
andSave
the file.Finder
select the downloaded.xcappdata
file, right click and selectShow Package Contents
.Appdata
->Preferencers
->Library
.