Launchctl

From The iPhone Wiki
Jump to: navigation, search

Location

The launchctl binary file is located in /bin.


Usage

If you type "launchctl help", you get a list of available commands. This is the output of "launchctl help" when done on an iPod Touch 2nd Generation running iOS 4.2.1:

usage: launchctl <subcommand>
       load            Load configuration files and/or directories
       unload          Unload configuration files and/or directories
       start           Start specified job
       stop            Stop specified job
       submit          Submit a job from the command line
       remove          Remove specified job
       bootstrap       Bootstrap launchd
       list            List jobs and information about jobs
       setenv          Set an environmental variable in launchd
       unsetenv        Unset an environmental variable in launchd
       getenv          Get an environmental variable from launchd
       export          Export shell settings from launchd
       debug           Set the WaitForDebugger flag for the target job to true.
       limit           View and adjust launchd resource limits
       stdout          Redirect launchd's standard out to the given path
       stderr          Redirect launchd's standard error to the given path
       shutdown        Prepare for system shutdown
       singleuser      Switch to single-user mode
       getrusage       Get resource usage statistics from launchd
       log             Adjust the logging level or mask of launchd
       umask           Change launchd's umask
       bsexec          Execute a process within a different Mach bootstrap subset
       bslist          List Mach bootstrap services and optional servers
       bstree          Show the entire Mach bootstrap tree. Requires root privileges.
       managerpid      Print the PID of the launchd managing this Mach bootstrap.
       manageruid      Print the UID of the launchd managing this Mach bootstrap.
       managername     Print the name of this Mach bootstrap.
       exit            Exit the interactive invocation of launchctl
       quit            Quit the interactive invocation of launchctl
       help            This help output

Notes

This command does not need to be run as root. Mobile will do fine. Also, this command should not differ much on your device from that of my test-device. If it does, please let me know and I will update this page accordingly.

Before iOS 6.1.3, this command used the arguements located in /etc/launchd.conf and executed them on startup. This is how evasi0n achieved an untethered jailbreak. Please see launchd.conf untether for more information.

Parents

(root)/bin