Completely remove Mac App Store app?

My QA team is testing our app for the Mac App Store and some of that involves resetting the app completely to its initial state. I'm having trouble finding documentation on exactly what should be removed to do this.


The app contains an embedded Network Extension, which is part of a shared app group with the container app. None of the apps explicitly write anything to the file system (only through UserDefaults).


Here's what I've told them to do:


Quit the app (if it's running).


Delete the app from Applications.


Remove the container app's defaults file:

rm -f ~/Library/Containers/com.mycompany.app/Data/Library/Preferences/com.mycompany.app.plist


Remove the network extension's defaults file:

rm -f ~/Library/Containers/com.mycompany.app.PacketTunnelProvider/Data/Library/Preferences/com.mycompany.app.PacketTunnelProvider.plist


Remove the app group's defaults file:

rm -f ~/Library/Group\ Containers/com.mycompany.appgroup/Library/Preferences/com.mycompany.appgroup.plist


Is that all that needs to be done? Or should I be removing the entire container folders? Or what? Also, should they be rebooting after this?


Also as a bonus question: It's throwing them off that it doesn't work like on iOS where when you delete the app, its settings / content get cleared. As far as I know, there's no way for me to do that. Is that correct?

Replies

The best way to test the ‘fresh install’ scenario on the Mac is to run your tests in a virtual machine, rolling back to a snapshot between each test.

Trying to reset the Mac back to its original state by hand is going to be very difficult. There are other issues above and beyond the ‘obvious’ ones you’ve already noticed (for example, the Mac tracks Network Extension providers via Launch Services and resetting Launch Services is not easy). Rather than trying to track down and reset each bit of state, rolling back your VM does everything at once.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"