help | 18 Help and tips in case of problems | Clean up Swyx Desktop for macOS
18.6 Clean up Swyx Desktop for macOS
If Swyx Desktop for macOS does not react immediately after startup or if you experience delayed startup performance, cleaning up Swyx Desktop for macOS might help.
To clean up Swyx Desktop for macOS 
1 Execute the following command in the Terminal App
osascript -e 'quit app "Swyx Desktop"
mkdir ~/Desktop/SwyxDB
cp -R ~/Library/Containers/com.swyx.Swyx-Desktop/Data/Library/Application\ Support/default.realm* ~/Desktop/SwyxDB/
rm -R ~/Library/Containers/com.swyx.Swyx-Desktop/Data/Library/Application\ Support/default.realm*
Swyx Desktop for macOS is terminated. A folder "SwyxDB" will be created into which the realm database files from the sandbox container will be copied. This folder is then deleted.
To clean up Swyx Desktop for macOS using a script 
1 Copy the following text into an editor and save the file for example under the name "swyx_clean.sh". Then run the script.
 
#!/bin/bash
# This script delete the container folder of Swyx
# and restart the preference process #
# Useful to have a fresh clean start of the MacOS app
printf "Swyx cleaner script.\n"
printf "VERSION: 1.3 - 31-05-2017"
printf "\n"
printf "This script performs the following steps:\n"
printf "1) Killing any running Swyx desktop process.\n"
printf "2) Delete the app user defaults.\n"
printf "3) Delete the app container folder.\n"
printf "4) Kill the preferences process.\n"
printf "5) (Optional) Reset the MacOS Privacy setting for the local contact access.\n"
printf"6) (Optional) Reset the MacOS extended file attributes for Application/Swyx\ Desktop.app\n"
printf "\n\n"
echo "Kill Swyx desktop processes"
kill -9 $(ps -ax | grep "Swyx Desktop" | awk '{printf "%i ", $1}') 2 /dev/null
echo "Deleting Swyx user defaults"
defaults delete "com.swyx.Swyx-Desktop
echo "Deleting container folder"
rm -r ~/Library/Containers/com.swyx.Swyx-Desktop 2>/dev/null
PID=`(ps -ef | grep cfprefsd | grep agent | grep -v grep | awk '{print $2}')`
if [ -z $PID ]; then
echo "Process cfprefsd not found. Skipped."
else
echo "The process cfprefsdi with ID $PID is going to be killed."
fi
kill -9 $PID 2>/dev/null
# Alternatively, should this not work properly: try to kill all cfprefsd services (deamon too) with
# command below (may require sudo)
# killall cfprefsd
# Execute this command if you want to reset also the Contact Access Preference
while true; do
read -p "Do you want to clean the contact privacy settings? [Y/N]" yn
case $yn in
[Yy]* )
tccutil reset AddressBook;
echo "Contact privacy access cleaned";
break;;
[Nn]* )
echo "Contact privacy access clean skipped";
break;;
* ) echo "Please answer yes or no.";;
esac
done
# This command may resolve issues when the OS is flagging the app bundle as corrupt or untrusted
# Not clear why/when this happens but it was observer on Yosemitee & El Capian and may be linked signing certificates
# that were renewed. The OS then asks to move the app to trash when double-clicked
while true; do
read -p "Do you want to reset extended file attributes on /Applications/Swyx\ Desktop.app? [Y/N]" yn
case $yn in
[Yy]* )
xattr -rc /Applications/Swyx\ Desktop.app;
echo "Extended file attributes reset";
break;;
[Nn]* )
break;;
* ) echo "Please answer yes or no.";;
esac
done
echo "Done."
Last modified date: 12.22.2021