IOS-sandbox mechanism (1)

Source: Internet
Author: User

IOS sandbox Mechanism
For security purposes, applications can only write their own data and preference settings to specific locations. When an application is installed on a device, the system creates a home directory for it, which is the sandbox of the application. Therefore, all files must be saved here, such as icons, sounds, images, attribute lists, and text files. (For security reasons, iOS places each app (including its preferences and data) in a sandbox at install time. A sandbox is a set of fine-grained controls that limit the app's access to files, preferences, network resources, hardware, and so on. as part of the sandboxing process, the system installeach app in its own sandbox directory, which acts as the home for the app and its data .)
1. Each application has its own storage space. 2. The application cannot access the content of another bucket through its own walls. 3. The data requested by the application must pass permission detection, if the condition is not met, it will not be released. Sandbox is a security system. All operations of an application must be performed through this system. The core content of this system is sandbox's permission restrictions on various operations performed on the application.


Sandbox in simulator 2 <喎?http: www.bkjia.com kf ware vc " target="_blank" class="keylink"> Pipeline + CiAgICAgIM/Cw + a/tL + pipeline/pipeline + pipeline/queues/rLYzsS8/rzQwO + jrNbQzsS90NfK1LS/queues + pipeline/queues + Co7q08r + pipeline + cjxwPgo8L3A + CjxwcmUgY2xhc3M9 "brush: java; "> command for displaying hidden Mac files: defaults write com. apple. finder AppleShowAllFiles-bool true command for hiding Mac hidden files: defaults write com. apple. finder AppleShowAllFiles-bool false after entering the key, click Enter to exit the terminal, and restart the Finder.

Restart Finder: Click the apple icon in the upper left corner of the window --> force exit --> Finder->
Now you can see the resource library folder.
Open the resource library and find the/Application Support/iPhone Simulator/folder. This is the sandbox directory of each program in the simulator.

Method 2: This method is more convenient. On the Finder, click-> go to the folder and enter/Users/username/Library/Application Support/iPhone Simulator. Enter your username here. Or ~ /Library/Application Support/iPhone Simulator /(~ Indicates the current user directory)



Three directory structure

By default, each sandbox contains three folders: Documents, Library, and tmp. Because of the sandbox mechanism, the application can only read and write file Documents under these directories: Apple recommends that you save the file data created in the program or browsed in the program to this directory, this directory is included in iTunes backup and recovery.

Library: the default setting of the storage program or other status information. Library/Caches: stores cached files. iTunes will not back up this directory, and files in this directory will not exit the application and delete tmp: allows you to create temporary files in real time. During synchronization with the iPhone, iTunes backs up all Documents and Library files. When the iPhone restarts, It discards all tmp files.
Is the three directories mentioned above: Documents, Library, tmp, XXX. app

Is a complete home directory structure:

Html

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.