Is there a way to see what's been saved to NSUserDefaults
directly? I'd like to see if my data saved correctly.
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
- “Zero out” sensitive String data in Swift
相关文章
- 现在使用swift开发ios应用好还是swift?
- Visual Studio Code, MAC OS X, OmniSharp server is
- UITableView dragging distance with UIRefreshContro
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- xcode 4 garbage collection removed?
- IntelliJ IDEA can't open projects or add SDK o
- Automator: How do I use the Choose from List actio
For OS X applications, instead of finding the application's defaults plist file, it is simpler to use the
defaults
command line utility.Example:
After reading this question's accepted answer, I put together this simple script that opens the plist files used by the iOS simulator to store the
NSUserDefaults
preferences, and while it assumes a certain setup (fits mine perfectly), it may work as a starting point for others.Example placement:
Use below code.
You can check the values for each key in the array, returned by
In Swift 2.2
will print out NSUserDefaults's plist file folder location in Xcode debug console. Copy the path string. Open your Finder, select Go to Folder in Go menu item, Paste the path string. Double click the plist file. You will see the contents in your Xcode editor.
Only work in Simulator
Thanks @Niels Castle
Simulator App
This shell script search for the name of the app, obtain the bundle id, and open folders containing the Plist files.
Extended script version
Usage:
iphone-app-folder "My App"
Mac App