Xcode changing application subfolder?

Hi, I noticed today that when writing a simple iPhone application, Xcode sometimes launches a new folder in applications while you are still working in the same application.

/Users/Fuzzygoat/Library/Application Support/iPhone Simulator/User/Applications/4E5EF4F0-F410-46A6-888C-0D23BB97D2DC 

Does anyone know what makes Xcode replace the new application folder (i.e. the one called "4E5EF4F0-F410-46A6-888C-0D23BB97D2DC")

EDIT_001: One thing I noticed is that I do a lot with the exit of the application and restart to check the set of archive methods, and this sometimes confuses it. A couple of times he did not find the saved data, I think this is just a side effect of constantly running the simulator again and again through Xcode. Everything seems to be going fine, if I test the simulator without Xcode, for starters, the folder retains the same name.

NB: I use NSSearchPathForDirectoriesInDomains to get a document folder every time.

Gary

0
source share
2 answers

For security reasons, iPhone OS restricts the application (including its settings and data) to a unique location on the file system. This limitation is part of the security feature known as sandbox applications. A sandbox is a collection of fine-grained controls that limit application access to files, preferences, network resources, hardware, etc. On iPhone OS, the application and its data are in a safe place, which no other application can access. When the application is installed, the system calculates a unique opaque identifier for the application. Using the application root directory and this identifier, the system creates the path to the application home directory. Thus, the home application directory can be depicted as having the following structure:

  /ApplicationRoot/ApplicationID/ 

During installation, the system creates a home application directory and several key subdirectories, configures the application sandbox, and copies the application package to the home directory. Using a unique location for each application and its data simplifies backup and restore operations, application updates, and deletion. Learn more about the directories of specific applications created for each application, as well as application updates and backup and restore operations.

see application sandbox

+3
source

I know this happens when you restart the simulator. At least that's what I definitely watched for it.

Developer docs tell you that the path may change without warning and never depend on it. This is part of the iPhone security system that prevents malicious applications from using hard-wired paths to search for and use system resources.

+2
source

Source: https://habr.com/ru/post/1241234/


All Articles