Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

SurveillanceVan

macrumors newbie
Original poster
Sep 22, 2023
2
0
I've been unable to log into my account when ApplePersistence is enabled (defaults write -g ApplePersistence 1). If the setting is active, the system hangs after I enter my password, as if it were waiting for a previously open application to relaunch.

Weirdly, if I hold down Shift while clicking the login button, it eventually loads to the desktop, but only the Dock visible, the menu bar just won't appear. And even then, if I attempt to launch something from the Dock, the app icon just starts jumping indefinitely and the app never launches. Afterwards Finder seems to be frozen as well.

Other accounts work fine. Even though I don't like apps automatically relaunching after logging in, disabling ApplePersistence results in a significantly longer wait time of around 15 seconds before I get to see the desktop. This is the main reason why I'd want to fix the issue.

To be honest, I can't recall any actions that might have caused this (other than upgrading Homebrew packages).

I've updated multiple times since the problem appeared. The Sonoma update didn't resolve it either.
 
Why do you set defaults write -g ApplePersistence 1?
Isn't it enough to Deselect ”Reopen windows when logging back in” https://support.apple.com/en-us/102318
Might be enough for the most part, but the option is ignored if a restart is initiated when upgrading the system or when using the 'reboot' command. I usually prefer a clean start rather than restoring the previous session.
 
Hi. Faced exactly the same issue here.

Solved by launching Recovery mode (Cmd+R when powering up), then mounting the Macintosh HD, then:
Code:
cd /Volumes/Macintosh\ HD\ -\ Data/Users/username/Library/Preferences/
cp .GlobalPreferences.plist .GlobalPreferences.plist.backup
plutils -convert xml1 .GlobalPreferences.plist
vim .GlobalPreferences.plist
Now find and delete the block:
Code:
<key>ApplePersistence</key>
<true/>

Convert it back
Code:
plutils -convert binary1 .GlobalPreferences.plist
Log in successfully to the system.

Hope it helps someone in the future.
 
Hi. Faced exactly the same issue here.

Solved by launching Recovery mode (Cmd+R when powering up), then mounting the Macintosh HD, then:
Code:
cd /Volumes/Macintosh\ HD\ -\ Data/Users/username/Library/Preferences/
cp .GlobalPreferences.plist .GlobalPreferences.plist.backup
plutils -convert xml1 .GlobalPreferences.plist
vim .GlobalPreferences.plist
Now find and delete the block:
Code:
<key>ApplePersistence</key>
<true/>

Convert it back
Code:
plutils -convert binary1 .GlobalPreferences.plist
Log in successfully to the system.

Hope it helps someone in the future.
An "AI" bot told you to do all that nonsense?
It's one line from Terminal, no need for Recovery:
Code:
defaults delete -g ApplePersistence
 
An "AI" bot told you to do all that nonsense?
It's one line from Terminal, no need for Recovery:
Code:
defaults delete -g ApplePersistence

Hi bogdanw. I saw your message above and tried it. But it seems to me that you don't really understand the issue that we with SurveillanceVan faced: we were unable to launch the terminal and execute the "delete" command.

When you boot in Recovery mode, it doesn't use the same properties files, so executing your command just returns "Defaults have not been changed".

If you know a way to "chroot" into a user from Recovery mode to execute a command as if I were that user, please share it, so that your answer becomes useful. Google and AI bot nonsense didn't work for me — when trying to chroot, it said something like "some library not found". So I didn't find a way to execute your command agains the files that needed to be changed.

Regards,
 
If you know a way to "chroot" into a user from Recovery mode to execute a command as if I were that user, please share it, so that your answer becomes useful.
If you don’t have multiple accounts like SurveillanceVan or still can’t login in Safe Mode, from Recovery:
Code:
defaults delete “/Volumes/Macintosh HD – Data/Users/username/Library/Preferences/.GlobalPreferences.plist ApplePersistence
 
  • Like
Reactions: lamer2024
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.