├── README.md └── reset-app-store-app.sh /README.md: -------------------------------------------------------------------------------- 1 | # reset-app-store-app 2 | 3 | Run this when the Mac App Store App just spins and spins 4 | 5 | 6 | This script will automatically execute the steps mentioned in my MacStories article: 7 | 8 | [What to Do When the Mac App Store App Just Spins and Spins](https://www.macstories.net/mac/what-to-do-when-the-mac-app-store-app-just-spins-and-spins/) 9 | 10 | 1. Quits the App Store app, if running 11 | 12 | 2. Enables the Debug Menu in the App Store app 13 | 14 | 3. Removes any file/folder “com.apple.appstore” in “/private/var/folders” (requires root/sudo) 15 | 16 | 4. Reboots the computer. 17 | 18 | It works for me, but use entirely at your own risk. 19 | 20 | 21 | ## Advanced Usage 22 | 23 | 24 | zsh -c "$(curl -sL https://raw.githubusercontent.com/tjluoma/reset-app-store-app/master/reset-app-store-app.sh)" 25 | 26 | or, more compactly: 27 | 28 | zsh -c "$(curl -sL http://luo.ma/rasa.sh)" 29 | 30 | -------------------------------------------------------------------------------- /reset-app-store-app.sh: -------------------------------------------------------------------------------- 1 | #!/bin/zsh -f 2 | # Purpose: 3 | # 4 | # From: Timothy J. Luoma 5 | # Mail: luomat at gmail dot com 6 | # Date: 2016-04-12 7 | 8 | NAME="reset-app-store-app.sh" 9 | 10 | if [ -e "$HOME/.path" ] 11 | then 12 | source "$HOME/.path" 13 | else 14 | PATH='/usr/local/scripts:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin' 15 | fi 16 | 17 | 18 | while [ "`pgrep -x 'App Store'`" != "" ] 19 | do 20 | echo "$NAME: Telling App Store app to quit" 21 | 22 | osascript -e 'tell application "App Store" to quit' 23 | sleep 5 24 | 25 | done 26 | 27 | defaults write com.apple.appstore ShowDebugMenu -bool true >/dev/null 28 | 29 | defaults read com.apple.appstore ShowDebugMenu >/dev/null 30 | 31 | ######################################################################################################################## 32 | 33 | echo "$NAME: Next you will be asked to enter your administrator's password." 34 | 35 | echo " Doing to will attempt to delete Mac App Store cache files, and then reboot your computer immediately." 36 | 37 | echo " Be sure you are ready to reboot before continuing." 38 | 39 | echo 40 | 41 | read "?Press 'Y' and enter to confirm, or any other key to quit. [y/N] " ANSWER 42 | 43 | case "$ANSWER" in 44 | Y*|y*) 45 | : 46 | ;; 47 | 48 | *) 49 | echo "$NAME: Not continuing" 50 | exit 0 51 | ;; 52 | 53 | esac 54 | 55 | 56 | sudo find /private/var/folders -ipath '*com.apple.appstore*' -depth -mindepth 4 -delete -print 57 | 58 | sudo shutdown -r +1 59 | 60 | echo "\n\n\t$NAME: Finished. You have 1 minute to save any unsaved changes before the computer will reboot.\n\n" 61 | 62 | ######################################################################################################################## 63 | 64 | 65 | exit 0 66 | #EOF 67 | --------------------------------------------------------------------------------