Every IOS program has its own file system. This file system is called sanbox, which stores files other than this code, other applications cannot access the sandbox of the program,
How can I view the sandbox locally?
Under normal circumstances, some files in the finder file are hidden to prevent user destruction. open the file using commands in the terminal.
Command for displaying Mac hidden files: Defaults write com. Apple. Finder appleshowallfiles-booltrue
Command for hiding Mac hidden files: Defaults write com. Apple. Finder appleshowallfiles-boolfalse
Enter the preceding command on the terminal, press enter, and restart the finder.
To restart the finder, follow these steps:
Then open the hard drive file on the Mac and find the user directory, such as my
If the color is a little lighter, the rectangular frame is circled (only marked part) and all the files are hidden by the system.
In the user directory, I opened "Export XY ".
Open the "resource library" under rjxy, and the file is normally hidden.
Find the application support file
Comparison: Create a project folder and a folder under the sandbox in the simulator
Under the project directory
Sandbox
The path of database. sqlite3 is output here.
Databse --->/users/rjxy/library/Application Support/iPhone simulator/5.1/applications/07001bf1-d6c5-4b8c-8e8a-d7b1e4d130ea/Documents ents/database. sqlite3
The following method is used to find database. sqlite3:
# Define kdatabasename @ "database. sqlite3"
Databasefilepath is an nsstring object
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentDirectory = [paths objectAtIndex:0]; self.databaseFilePath = [documentDirectory stringByAppendingPathComponent:kDatabaseName]; NSLog(@"databse--->%@",databaseFilePath);