The desktop clients of all well-known cloud providers turned out to be quite reliable after maturing over the years. But, occasionally, synchronization just stops while some unexpected problems occur that seem to come straight out of the nowhere. Exactly this happened to me when using macOS in combination with the OneDrive-client from the AppStore: Neither the private nor the business Office 365-account could be added. Even the deinstallation of the app did not succeed. The result was a grayed out OneDrive-icon residing in my menu bar, so what to do?
As it happens quite often, the Devil hides in the detail - the classic app removal via the recycle bin did not succeed. Even the search for all those little configuration files or the automated removal with apps like AppCleaner got me (still) stuck in a dead end. OneDrive was just reluctant and that is - according to a standard macOS behavior - a really strange constellation. Maybe it was my fault, using the same E-Mail-address for my private and corporate Office 365-account? Good question, but basically quite far away if being seen from a logical point of view.
After all I continued to venture through the World Wide Web while still being on search for a solution and finally found the official FAQ for OneDrive for Mac. A small hint told me to show the package contents of the OneDrive-app after closing it. So I went to the app's location on my hard disk, right-clicked the app and chose "Show Package Contents". Don't be confused of the German screenshot here as my production Mac at home is - well - located in Germany!
Then continue your journey to the folder „Contents“, followed by the folder „Resources“. Looking around there, you will find a script named „ResetOneDriveApp.command“ as long as you have installed your client via Apple's AppStore. Just in case you use the standalone-version of the client, the filename is „ResetOneDriveAppStandalone.command“. You may have guessed the intention of both files: A double-click executes a specific shell-script which generates the following output in Terminal:
This Terminal window can now be closed. Et voilà - the OneDrive-app is now reborn again straight from the scratch. You may now head on to connect your private or corporate OneDrive-account again with your Mac, realizing that the synchronization works as expected. Problem solved!