View IOS sandbox (sanbox) files

Source: Internet
Author: User

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);



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.