简体   繁体   中英

Does deleting a app from simulator remove files?

I was storing some files in the Documents/ folder of my application using archiving. Then, I removed the application from simulator. It seems the files that were inside the Documents/ folder got removed too. Is it the expected behaviour? Thank you.

Yes. This applies to the simulator and the iPhone.

Because of the sandbox, all the application's documents are stored on the application's bundle.
So obviously, removing an app also removes the documents.

So this is the expected behaviour. Otherwise, you'll just have tons of junk data taking space on your phone.

-- Edit --

To answer the question you asked in the comments, the easiest way IMHO is to have a directory containing your files elsewhere.
Then you can symlink the Documents directory in the app's bundle so it points to the other location. This way, when deleting the app from the simulator, it won't delete the files.
Repeat the process when installing again.

Yes, If you remove the app from simulator then it will definitely remove your data because you have given the simulator's path for storing that data. It will stay until you have your app in your simulator.

Yes. When you delete the app, its sandbox gets removed too.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM