I want a an app that is “self-contained” (I don’t know if i use the right word. “putting the app into trash bin will remove everything” is what I meant). But the app requires some resources to run. I usually put those resources into a folder. I want to move those resources into the App folder ( package contents). Can I do that? Is it a good practice to do that?
When I test the app directly running from Xcode, the App runs fine. But if i run it from finder, the app will say fails to create resources folder because permission denied. I checked the app’s folder permission – User(me) has read/write access. I am wondering what is causing this different behavior.
The last option is to use Application Support folder, but I don’t want to leave trails when user deletes the app.
Can someone help me out here?
Applications live in the directory
/Applications, where users don’t generally have write access. Requiring an app to have write permission in system folders is extremely bad practice.Runtime files should live in
~/Library/Application Support. While that folder tends to accumulate some cruft, unless your application leaves behind really large files, that shouldn’t be a problem.If you want your application to be self-contained, it needs to come with all the files it needs from the get-go, and not write anything to disk.