Manual Reference Pages  - applejack (8)


applejack AppleJack - A basic troubleshooting and repair utility for single user mode (Mac OS X).


Terms Of Use
See Also
Known Issues


applejack [[auto|AUTO [restart|shutdown]]] applejack [[uninstall]] applejack [[version | --version | -v]]


applejack is a utility for more easily running basic Mac OS X diagnostics and troubleshooting in single user mode. If there is no second startup CD or hard drive available, or the graphical user interface cannot be started, it can be impossible to repair the startup disk, or fix permissions. applejack also deletes possibly problematic system cache files, and swap files. In short, applejack can clean up a Mac OS X system without recourse to a secondary boot up option. WARNING: Using applejack outside of single user mode can bring down your system!


auto Tells applejack to iterate through its tasks in order, with a small time delay between each task.
AUTO This is just like auto, except that AppleJack will go into "deep clean" mode, meaning that it will clear out ALL system caches, not sparing the LaunchServices database, etc. Use this option only if you are still having trouble booting up after a previous use of AppleJack.
  If you are running applejack in auto mode, adding the restart option tells applejack to restart the computer automatically at the end of the script. The restart option will have no effect unless you specify the preceding auto option.
  If you would rather shut down after running AppleJack, just add shutdown instead of restart. Shutdown has no effect unless you specify the preceding auto option.
  If you type uninstall, AppleJack will proceed to uninstall itself.
  Just what you expect. If you type version, --version, or -v, AppleJack will print out its version and revision number and then exit.


1. Restart your computer. After you hear the startup chime, press and hold down the
  Cmd and s keys together (this will put you in single user mode). You should soon get a Terminal-type screen with a dramatic garble of indecipherable messages and a shell prompt that looks something like [root#]

2. Now, type
  applejack at the prompt. (If you’ve installed applejack manually, or have not created an alias to applejack for the root user, you may have to enter the full path to the script at the prompt.) You will be guided through a series of steps that will repair your drive and delete possibly corrupted files. Options are selected by typing the number corresponding to the task you want to perform, and then hitting the return key. For example, when you see a few different options, like this:

[1] Option One [2] Do something else [3] Another task [4] A useful task

From time to time, in interactive mode, you will be asked to answer yes or no to a question. To answer yes, type y and hit the return key. To answer no, type n and hit the return key.

An advantage of using the interactive mode instead of auto mode is that you are given options for also cleaning out user-level caches and preference files. If you would like to clean out your main admin user caches, for example, you will need to use interactive mode.

3. Auto mode: If you want to leave
  applejack to do it’s own thing, just choose option [a] when the script starts. You can also start right up in auto mode by typing: applejack auto at the prompt. applejack will run through all the basic cleanup tasks in order. Alternatively, you can also type applejack auto restart which will tell applejack to do the cleanup tasks and then automatically restart your computer. Other options are: applejack auto shutdown which tells AppleJack to shut down the computer after running its tasks, or applejack AUTO shutdown which tells AppleJack to run automatically in "deep cleaning" mode (see above) and then shut down.


AppleJack, an open source basic troubleshooting utility for Mac OS X

Copyright (c) 2002-10 Kristofer Widholm, The Apotek

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

You can reach The Apotek at

For more information, please see the project’s home page at <>


This product is freeware, and open source. However, if you like this product, and would like to help further its development, please consider making a small donation at: <> or <>


applejack alias to the location of the applejack executable (shell script)


/private/var/root/Library/Scripts/ applejack shell script (executable)
/usr/share/man/man8/applejack.8 applejack manual page
/private/var/root/.profile applejack installer adds or modifies this file in order to create an alias to applejack in the root user’s environment.
/private/var/log/AppleJack.log applejack outputs the results of its work in this log file. The log is reset automatically when it reaches a size of 500 kilobytes or more.


bless(8), diskutil(8), dscl(1), fsck(8), fsck_hfs(8), launchctl(1), launchd(8,) mach_init(8), mount(8), mount_hfs(8), nicl(1), plutil(1)


* (all versions) Sometimes odd error or log messages will show up from the Mac OS X subsystem and insert themselves right into AppleJack’s interface. In single user mode, the screen is the console, so it is extremely difficult to suppress all these messages. Normally you can ignore them as long as you can still use the interface.

* (all versions) After running AppleJack and deleting the cache files, some users experience odd behavior in the finder or with application launches. This is because Mac OS X did not rebuild the lost cache files correctly. Behaviors include: Finder keyboard shortcuts not working, menu items not appearing correctly, user images gone, inability to launch various applications. A restart will usually correct these errors.

* Some users of G5 systems have reported that the fans ramp up very fast. This is not related to AppleJack, but is due to the fact that the thermal controllers are not loaded while in single user mode. If this condition persists after restarting into Mac OS X, you may have run into one of the many known fan-management bugs. See the support forums, or for extensive postings on this topic.

* (v 1.4.2) On Mac OS X 10.4.3, some users report that when launching some of the services necessary for permissions repair, the system will take a long time (3-4 mins) before being launching the actual permissions repair. I do believe this issue will have been addressed by the 1.4.3 release of AppleJack.

* (v. 1.5) On Mac OS X 10.5.x, permissions repair seems to have slowed down again. I’m not sure why diskutil behaves so differently in single user mode from when being invoked in the context of the Disk Utility GUI program, but there you have it. It does work, but it is slower than on Tiger.

* (v. 1.4) Some users running Mac OS X 10.4, 10.4.1, and 10.4.2 report that their system will suddenly start spitting out a line like ’Limiting closed port RST response from 251 to 250 packets per second’. Some users have been able to continue to use AppleJack by ignoring the lines being written to the screen, while others appear to have their computers hang when this happens. This appears to be related to changes in the boot sequence introduced in Tiger, and the manner in which a user upgraded to Tiger—though no clear pattern has emerged. It appears that the new boot mechanism (relying upon launchd rather than init) has some issues when used in single user mode. Anecdotal reports indicate that this problem might have disappeared in 10.4.3.

* (all versions) AppleJack and fsck (disk repair). When you run AppleJack in auto mode, it’s hard to know whether the disk repair actually has finished repairing all issues on the hard drive. This is because the disk repair utility (the "fsck" program) returns a 0 when finished if a) there were no errors, or b) the errors were fixed. There might possibly be errors that weren’t fixed, but there’s no way for AppleJack to know this. If you’d like to make 100% certain that your hard drive has been repaired, I recommend you run AppleJack in manual mode so you can repeat the disk repair routine until your disk gets a clean bill of health. If your disk never gets a clean bill of health, it’s time to back up your data and either reformat or use a tool like DiskWarrior. The built-in fsck has its limitations.* (all versions) Sometimes odd error or log messages will show up from the Mac OS X subsystem and insert themselves right into AppleJack’s interface. In single user mode, the screen is the console, so it is extremely difficult to suppress all these messages. Normally you can ignore them as long as you can still use the interface.

* (all versions) Shutdown due to power loss while running AppleJack. Users who are running AppleJack with an uninterruptible power supply (UPS) plugged into their USB ports report that shortly after the repair permissions task starts, they see the following error message before the CPU is halted:
        shutdown: halt by root: Shutting down due to power loss! The solution to the shutdown is to unplug the USB cable from the UPS.

Mon Sep 1 2008 applejack (8) Darwin
Generated by manServer 1.07 from applejack.8 using doc macros.