Where is user specified data being stored on MacOS - macos

I install an app .app file to /Applications folder.
Can you please tell me where does the user specified data being stored? How can I do to clean uninstall my application and its user specific data?
Thank you.

This depends on the application, unfortunately. Sometimes it is in ~/Library/ folder, though.

AppTrap should do the trick.
It runs in the background and simply has a preference pane in the System Preferences. Drop the application onto the trash folder and it will ask you whether you want the associated application files to be deleted too.

Just let the user do that. For instance with AppCleaner.
Otherwise, just give a way in your preferences to reset them. No need to delete the plist file.

AppDelete is a free program for uninstalling and cleaning up.
FSEventer is a free program for seeing where programs install themselves.

Most information is stored within /Library/, however from time to time you may find applications which store their data within the contents of the .app package itself, or within a subfolder in /Applications/.

This should give you an idea of where to look.
Where to Put Application Files

Related

How to make application autorun on Mac?

I want to make my application autorun, like using autorun.inf on Windows. I googled and there is one way for me to do that:
"On the Mac side there are many applications you can buy for creating a Finder window that looks a certain way but all these changes can be made within finder. You then will need to copy the DS_Store file to the CD and finder will automatically apply any changes that you have made.
Also using -hfs-openfolder will cause it to open automatically when inserted on the mac."
Can anyone tell me more clearly about that, or is there any other way?
Thanks so much.
According to this page, you should be able to do that with bless:
sudo bless --folder "/Volumes/discName" --openfolder "/Volumes/discName"
The man page confirms that, at least on 10.6.8. I don't have Lion in front of me right now.

Xcode - Can't see files in Documents directory using File Sharing

can somebody please help! I'm creating audio files using Xcode and placing those files in the 'documents' directory of my app, the point being that I can retreive them using iTunes and File Sharing.
I save the audio files as type .caf, I've created a directory list to make sure that all my files are actually there, they are. I NSLog the directory that the files are being stored to, it's the application documents folder. I have 'UIFileSharingEnabled/Application Supports iTunes Sharing' as TRUE in the info.plist. Everything seems to be working fine, EXCEPT... I just can't see the files in iTunes File Sharing. I KNOW they're there... I can even email them successfully from the same directory, but they don't show in iTunes.
Please can somebody help!
Thanks a lot!!!!
What you're saying doesn't really makes sense.
If you've done all the things you've mentioned properly, you should have had access to the application directory through iTunes.
Nevertheless, considering some problem still happens, you can do the following:
If you have SSH access to your phone (for jailbreak iPhone), you can use SSH to list the files on the documents directory.
If you don't have SSH, you have to solve the problem internally - through your application.
I recommend: List iPhone application document files

Remove Sandboxing

I have another question dealing with app sandboxing. So I need access to the users' home directory and at the same time the app should be able to shut down the Mac. This requires to not using sandboxing.
My problem is that I don't know how to remove sandboxing and being able to submit the app to the Mac App Store. I think that the archives are sandboxed because I had turned it on once..
How to remove sandboxing from the archives properly?
Thanks for your help!
On Xcode 11, you can turn off Sandboxing by removing it from the Signing & Capabilities tab:
If I understand what you are asking correctly, you'll need to remove the entitlements.plist from your project and make sure that the Summary view of your target in Xcode has sandboxing turned off:
As Derek Wade pointed out, you can make an App like GarageBand X (which behaves obnoxiously with third party plugins like Amplitube due to Sandboxing) NOT run in a sandbox by editing the binary itself with a HEX editor like HexFiend. Look for:
<key>com.apple.security.app-sandbox</key>
Immediately following that bit you'll see the true tag, which as suggested I switched to 'fals' (no extra bytes) and now GarageBand will happily interact with third party VST plugins. Huzzah.
I found if you go into the .app package, under Contents/MacOS, there should be a binary file that matches the name of your app. Copy that file to your desktop. Edit the desktop copy of the file with TextEdit. You should find within the file, the text representation (xml) of the Entitlements for the app. Find the Sandbox entitlement flag (usually set to <true/>) and change it to <false/>. You will have to unlock the file when editing. Save the file (located on the desktop). Rename the original file in the .app package (i.e. append .old to the filename). Copy the desktop file back to the .app Package location (you may have to authorize it). This should remove the sandboxing.
You cannot remove Sandbox if the user ran you application via Sandbox.
That's the whole point - don't you think ?

how to detect files related to an app on a mac

I am wondering how an application like appzapper can detect the files related to an application?
All ideas are welcome.
Thanks for your help,
Regards,
By looking into the standard locations that usually are used by applications to store preferences (like Library/Preferences/ , Library/Caches, etc., both in your home directory ~/ and under / ) I couldn´t find any file or folder that isn´t using either the applications name (eg. ~/Library/Application Support/Firefox) or it´s bundle identifier (eg. ~/Library/Preferences/org.mozilla.firefox.plist) in its name; so I guess they´re just using that.
In the case of AppZapper you can go ahead and try for any (not currently running) Application to rename the ~/Library/Application Support/AppName folder for example to ~/Library/Application Support/111AppName - AppZapper doesn´t find it anymore. If you change it to ~/Library/Application Support/AppName111 it shows up as a related file.
Out of this you can conclude that there isn´t any magical linkage between a folder full of preferences and it´s associated application that AppZapper is reading out, it´s merely checking for folders starting with the Application´s Name.

File Watcher in Cocoa

Hai all, I am developing an application in cocoa.I want to constantly check whether the contents of a file in a particular location is changed or not (like FileSystemWatcher in .NET).Please anyone give me a solution.I used FSEvent but it monitors only folder for changes...But I need to know whether a file in that folder is changed or not ..Please anyone help me ......
When you get an FSEvent for the folder containing your file, check your file's mod date to see if it's the one that changed. FSEvent doesn't offer finer granularity than that.

Resources