Launchpad resets on restart
I had a problem with launchpad resetting or shuffling icon positions every time I restart. I have a completely new MacBook Pro with Sonoma, clean install, changed nothing on the default system settings, applications or folders, no funny business, just downloaded a couple of programs like PyCharm, Firefox, Steam etc. and arranged the launchpad icons the way I needed them. And on the next restart all icons were shuffled around. Same outcome every time I rearranged icons and restarted. I had this problem once a couple of years ago, when I updated my old MacBook to Monterey but could not remember what solved it back then. On an internet search, you can find tons of threads for any Mac OS in posts from 10 years ago until a few months old. Solutions there and on this forum were not fixing it, most of them giving the killall dock command line for Terminal which resets launchpad but the outcome is the same. Or people come up with routines like "reboot, wait 3 days then reboot again, wait 2 days, spin in a circle, clap your hands and bury an olive at new moon", after which their launchpad was "rock solid". People were willing to try anything.
The only thing that worked however, is this:
In Terminal, enter this line to reset launchpad (most answers gave this advice, already):
defaults write com.apple.dock ResetLaunchPad -bool true; killall Dock
You should notice the dock reloading and launchpad resetting to defaults.
Then, enter this line:
rm ~/Library/Application\ Support/Dock/*.db; killall Dock
You should notice the dock reloading again and if you rearrange launchpad icons now, it should stick without shuffling on restart.
With only the first command line given in 90% of answers that at least offered something beyond new moon spell casting, the problem wasn't solved. The 2nd line is what was missing, in this case. Hopefully, it works for you, too.
Found here https://gist.github.com/stvhwrd/2b0e310a3ed950a68973 from one helpful individual. Thank you so much!