Update README.md
Update README.md with uninstall & troubleshooting instructions
Thanks for your input. I’m very hesitant to add something like this, because this is not the intended way to uninstall. Let’s look at what must be done and which action accomplishes it:
- The application itself must be removed.
- The daemon must be deregistered.
- Pre-Ventura, the privileged helper must be removed.
- The custom AuthServices right must be removed.
- The BTM information must be removed.
- Optionally, preferences must be removed.
The intended way to uninstall Battery Toolkit is to Disable Background Activity from the menu and then to trash the application. Only as a fallback, if there are leftovers due to bugs in the application (or even macOS, that happened before), uninstall.sh is provided for troubleshooting. Now let’s look at which task cleans up what:
- Disable Background Activity does 2., 3., 4. and 6.
- Removing the application does 1. and 5. BTM is managed by macOS and it monitors things like deleting applications to update it. This process bugged out for me before when running an application from a mounted DMG, so I had a persistent background item entry seemingly impossible to remove with stock tools. I then replicated the former application location manually and deleted it again. Then BTM was updated and the entry was gone.
- uninstall.sh does the same as Disable Background Activity, but due to elevated rights from Terminal, it has a few less restrictions. This allows to recover from inconsistent states, such as the Developer ID changing in the past. Purely for troubleshooting and in rare cases.
To go even further, let’s look at Ventura+ specifically, as the application is self-contained from then onwards: 2.1. In addition to 1. and 5., removing the application and rebooting does 2. We can ignore 3. , as it only applies to Pre-Ventura. So, in fact only 4. and 6. are not handled. 6. is optional and may be a preference thing. If homebrew is deployed, I think it can even be configured. 4. is a tricky one and also a blocker for the homebrew deployment. When I get the time, I really need to reinvestigate whether the current system is really needed. If this could be made stateless, such that even force-terminating the daemon will not leave any trace of a custom right, that would resolve a lot of headache. Anyway, 4. is not necessary in terms of “removing the effects” of Battery Toolkit. It will be garbage in some database, but it will not cause any visible effects. Thus, on Ventura+, deleting the app and rebooting is effectively enough for the user to consider it uninstalled.
Now, it probably would be good to document Disable Background Activity properly for Pre-Ventura users and for the sake of purging the custom right and settings. It also would be good to add troubleshooting steps with uninstall.sh. I’m hesitant on adding something on recovering from BTM issues such as this, because it’s rare and confusing: https://github.com/mhaeuser/Battery-Toolkit/issues/7#issuecomment-2036664963 Finally, I’m very hesitant on adding commands for locating supposedly stray files, because they are all deleting as part of the intended and troubleshooting uninstall process. The only way for there to be any other is the user duplicating the app bundle somewhere or failing to remove it outright, at which point “not much can be done”. Homebrew would also resolve this.
Closing as there doesn't appear to be any interest left.