A lot of the time logging out and back in can be substituted for restarting, but is there something even quicker? Could you skip the graphical login window or at least having to enter the login password?

I often have to log out and back in to apply changes to property lists or keylayout files or to test something like launchd services.

  • The items you linked to refer to system startup as opposed to logging in and out. You can start up an OS X machine and log users in and out without rebooting. Could you clarify this so we can best answer you? Mar 28 '11 at 16:02
  • 1
    was there some specific application you installed that requested that you log out and log back in? Sometimes that's required to start newly installed system services. Agree with @Brad, please clarify your question.
    – fideli
    Mar 28 '11 at 16:31
  • Since you mention logging out and back in being part of a troubleshooting process, substituting it with a quickly hacked together shell script is a seriously stupid idea: You just have no way of knowing if everything you do manually is the way it's done by the system (which developers test against). And if you use FileVault, your home directory gets unmounted -- you just don't want to be logged in while that's done. I'd suggest you look at a way to automate changing the settings in Accounts.prefPane first, temporarily removing your password, things like that.
    – Daniel Beck
    Mar 28 '11 at 17:24
  • 1
    Further research -- while /System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -switchToUserID 502 allows you to switch to a different user, and the resulting window can be AppleScripted as in tell application "SecurityAgent" to activate, tell application "System Events" to tell application process "SecurityAgent" to {keystroke "pwd", keystroke return}, it doesn't seem possible to do this with the real loginwindow login.
    – Daniel Beck
    Apr 14 '11 at 13:22

Logging out merely closes all applications being run by the user in question. These could be GUI applications actually seen on screen or background processes. It also, obviously, closes the authenticated computer session, meaning no other user of the computer can sit down at your computer and look at, open, etc. your files.

It's rare that you are ever asked to restart in Mac OS X and even rarer that you are asked to logout. The only example I can think of is when switching video cards on 2008-2009 model MacBook Pros. In that scenario, OS X asks you to logout so it can close all running applications and the display driver itself, switch to the other video card and then come back.

Since, you didn't specify what exact problem you're experience/trying to solve, I can't be of much more help. But, to answer your primary question, no there is no "faster" way to do this because, again, all that's happening is all running processes are being killed. Additionally, you cannot bypass the login window because you have to authenticate yourself in order to access the computer account (files, settings, etc. specific to your user).

The only sidestep would be to enable single user login, where you're essentially telling OS X that you're the only user on the system and it should just go ahead and log you in automatically. But, that creates a bit of a security concern if your computer is ever available to anyone else: for instance, a laptop that you take out of your home.

  • Nope. You can have OS X remember your login password. It uses keychain like anything else. You will get a nasty warning detailing all the horrible, awful things that can result from taking that action, up to and including the deaths of large quantities of kittens and wide-eyes puppies, but ultimately it'll allow you to do it. Apr 8 '11 at 20:48

Temporarily delete the password on that account. Then Opt-Shift-Cmd-Q will log you out, and Enter or clicking your username (depending on your login screen option) will log you back in. It's not a push-button solution but it does ensure that everything a logout/login sequence is supposed to accomplish actually gets done.

  • I'd try that (passwd) on a throwaway account, first, in case there any strange or missing interactions with OS-X. Otherwise, for debugging, I wouldn't want to introduce any new variables so I'd just use Sys Prefs | Accounts | Change Password button to change the password. Probably not worth it for one-time logout/login, though.
    – JRobert
    Mar 29 '11 at 14:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.