iOS Reference Library Apple Developer
Search

Launch Services Keys

Launch Services (part of the Core Services framework in Mac OS X) provides support for launching applications and matching document types to applications. As a result, the keys recognized by Launch Services allow you to specify the desired execution environment for your bundled code. (In iOS, Launch Services is a private API but is still used internally to coordinate the execution environment of iOS applications.)

Launch Services keys use the prefix LS to distinguish them from other keys. For more information about Launch Services in Mac OS X, see Launch Services Programming Guide and Launch Services Reference.

Key Summary

Table 1 contains an alphabetical listing of Launch Services keys, the corresponding name for that key in the Xcode property list editor, a high-level description of each key, and the platforms on which you use it. Detailed information about each key is available in later sections.

Table 1  Summary of Launch Services keys

Key

Xcode name

Summary

Availability

LSArchitecturePriority

"Architecture priority”

Contains an array of strings identifying the supported code architectures and their preferred execution priority. See “LSArchitecturePriority” for details.

Mac OS X

LSBackgroundOnly

"Application is background only”

Specifies whether the application runs only in the background. (Mach-O applications only). See “LSBackgroundOnly” for details.

Mac OS X

LSEnvironment

"Environment variables”

Contains a list of key/value pairs, representing environment variables and their values. See “LSEnvironment” for details.

Mac OS X

LSFileQuarantineEnabled

"File quarantine enabled”

Specifies whether the files this application creates are quarantined by default. See “LSFileQuarantineEnabled.”

Mac OS X

LSFileQuarantineExcludedPathPatterns

None

Specifies directories for which files should not be automatically quarantined. See “LSFileQuarantineExcludedPathPatterns.”

Mac OS X

LSGetAppDiedEvents

"Application should get App Died events”

Specifies whether the application is notified when a child process dies. See “LSGetAppDiedEvents” for details.

Mac OS X

LSMinimumSystemVersion and

MinimumSystemVersion

"Minimum system version”

Specifies the minimum version of Mac OS X required for the application to run. See “LSMinimumSystemVersion” for details.

See “MinimumOSVersion” for details about the related iOS property, which is system-specified.

Mac OS X, iOS

LSMinimumSystemVersionByArchitecture

"Minimum system versions, per-architecture”

Specifies the minimum version of Mac OS X required to run a given platform architecture. See “LSMinimumSystemVersionByArchitecture” for details.

Mac OS X

LSMultipleInstancesProhibited

"Application prohibits multiple instances”

Specifies whether one user or multiple users can launch an application simultaneously. See “LSMultipleInstancesProhibited” for details.

Mac OS X

LSRequiresIPhoneOS

"Application requires iPhone environment”

Specifies whether the application is an iOS application. See “LSRequiresIPhoneOS” for details.

iOS

LSRequiresNativeExecution

"Application requires native environment”

Specifies whether the application must run natively on Intel-based Macintosh computers, as opposed to under Rosetta emulation. See “LSRequiresNativeExecution” for details.

Mac OS X

LSUIElement

"Application is agent (UIElement)”

Specifies whether the application is an agent application, that is, an application that should not appear in the Dock or Force Quit window. See “LSUIElement” for details.

Mac OS X

LSUIPresentationMode

"Application UI Presentation Mode”

Sets the visibility of system UI elements when the application launches. See “LSUIPresentationMode” for details.

Mac OS X

LSVisibleInClassic

"Application is visible in Classic”

Specifies whether an agent application or background-only application is visible to other applications in the Classic environment. See “LSVisibleInClassic” for details.

Mac OS X

LSArchitecturePriority

LSArchitecturePriority (Array - Mac OS X) is an array of strings that identifies the architectures this application supports. The order of the strings in this array dictates the preferred execution priority for the architectures. The possible strings for this array are listed in Table 2.

Table 2  Execution architecture identifiers

String

Description

i386

The 32-bit Intel architecture.

ppc

The 32-bit PowerPC architecture.

x86_64

The 64-bit Intel architecture.

ppc64

The 64-bit PowerPC architecture.

if a PowerPC architecture appears before either of the Intel architectures, Mac OS X runs the executable under Rosetta emulation on Intel-based Macintosh computers regardless by default. To force Mac OS X to use the current platform’s native architecture, include the “LSRequiresNativeExecution” key in your information property list.

LSBackgroundOnly

LSBackgroundOnly (Boolean - Mac OS X) specifies whether this application runs only in the background. If this key exists and is set to “1”, Launch Services runs the application in the background only. You can use this key to create faceless background applications. You should also use this key if your application uses higher-level frameworks that connect to the window server, but are not intended to be visible to users. Background applications must be compiled as Mach-O executables. This option is not available for CFM applications.

LSEnvironment

LSEnvironment (Dictionary - Mac OS X) defines environment variables to be set before launching this application. The names of the environment variables are the keys of the dictionary, with the values being the corresponding environment variable value. Both keys and values must be strings.

These environment variables are set only for applications launched through Launch Services. If you run your executable directly from the command line, these environment variables are not set.

LSFileQuarantineEnabled

LSFileQuarantineEnabled (Boolean - Mac OS X) specifies whether files this application creates are quarantined by default.

Value

Description

true

Files created by this application are quarantined by default. When quarantining files, the system automatically associates the timestamp, application name, and the bundle identifier with the quarantined file whenever possible. Your application can also get or set quarantine attributes as needed using Launch Services.

false

(Default) Files created by this application are not quarantined by default.

This key is available in Mac OS X v10.5 and later.

LSFileQuarantineExcludedPathPatterns

LSFileQuarantineExcludedPathPatterns (Array - Mac OS X) contains an array of strings indicating the paths for which you want to disable file quarantining. You can use this key to prevent file quarantines from affecting the performance of your application. Each string in the array is a shell-style path pattern, which means that special characters such as ~, *, and ? are automatically expanded according to the standard command-line rules. For example, a string of the form ~/Library/Caches/* would allow you to disable the quarantine for files created by your application in the user’s cache directory.

LSGetAppDiedEvents

LSGetAppDiedEvents (Boolean - Mac OS X) indicates whether the operation system notifies this application when when one of its child process terminates. If you set the value of this key to YES, the system sends your application an kAEApplicationDied Apple event for each child process as it terminates.

LSMinimumSystemVersion

LSMinimumSystemVersion (String - iOS, Mac OS X) indicates the minimum version of Mac OS X required for this application to run. This string must be of the form n.n.n where n is a number. The first number is the major version number of the system. The second and third numbers are minor revision numbers. For example, to support Mac OS X v10.4 and later, you would set the value of this key to "10.4.0".

If the minimum system version is not available, Mac OS X tries to display an alert panel notifying the user of that fact.

LSMinimumSystemVersionByArchitecture

LSMinimumSystemVersionByArchitecture (Dictionary - Mac OS X) specifies the earliest Mac OS X version for a set of architectures. This key contains a dictionary of key-value pairs. Each key corresponds to one of the architectures associated with the “LSArchitecturePriority” key. The value for each key is the minimum version of Mac OS X required for the application to run under that architecture. This string must be of the form n.n.n where n is a number. The first number is the major version number of the system. The second and third numbers are minor revision numbers. For example, to support Mac OS X v10.4.9 and later, you would set the value of this key to "10.4.9".

If the current system version is less than the required minimum version, Launch Services does not attempt to use the corresponding architecture. This key applies only to the selection of an execution architecture and can be used in conjunction with the “LSMinimumSystemVersion” key, which specifies the overall minimum system version requirement for the application.

LSMultipleInstancesProhibited

LSMultipleInstancesProhibited (Boolean - Mac OS X) indicates whether an application is prohibited from running simultaneously in multiple user sessions. If true, the application runs in only one user session at a time. You can use this key to prevent resource conflicts that might arise by sharing an application across multiple user sessions. For example, you might want to prevent users from accessing a custom USB device when it is already in use by a different user.

Launch Services returns an appropriate error code if the target application cannot be launched. If a user in another session is running the application, Launch Services returns a kLSMultipleSessionsNotSupportedErr error. If you attempt to launch a separate instance of an application in the current session, it returns kLSMultipleInstancesProhibitedErr.

LSRequiresIPhoneOS

LSRequiresIPhoneOS (Boolean - iOS) specifies whether the application can run only on iOS. If this key is set to YES, Launch Services allows the application to launch only when the host platform is iOS.

LSRequiresNativeExecution

LSRequiresNativeExecution (Boolean - Mac OS X) specifies whether to launch the application using the subbinary for the current architecture. If this key is set to YES, Launch Services always runs the application using the binary compiled for the current architecture. You can use this key to prevent a universal binary from being run under Rosetta emulation on an Intel-based Macintosh computer. For more information about configuring the execution architectures, see “LSArchitecturePriority.”

LSUIElement

LSUIElement (String - Mac OS X) specifies whether the application runs as an agent application. If this key is set to “1”, Launch Services runs the application as an agent application. Agent applications do not appear in the Dock or in the Force Quit window. Although they typically run as background applications, they can come to the foreground to present a user interface if desired. A click on a window belonging to an agent application brings that application forward to handle events.

The Dock and loginwindow are two applications that run as agent applications.

LSUIPresentationMode

LSUIPresentationMode (Number - Mac OS X) identifies the initial user-interface mode for the application. You would use this in applications that may need to take over portions of the screen that contain UI elements such as the Dock and menu bar. Most modes affect only UI elements that appear in the content area of the screen, that is, the area of the screen that does not include the menu bar. However, you can request that all UI elements be hidden as well.

This key is applicable to both Carbon and Cocoa applications and can be one of the following values:

Value

Description

0

Normal mode. In this mode, all standard system UI elements are visible. This is the default value.

1

Content suppressed mode. In this mode, system UI elements in the content area of the screen are hidden. UI elements may show themselves automatically in response to mouse movements or other user activity. For example, the Dock may show itself when the mouse moves into the Dock’s auto-show region.

2

Content hidden mode. In this mode, system UI elements in the content area of the screen are hidden and do not automatically show themselves in response to mouse movements or user activity.

3

All hidden mode. In this mode, all UI elements are hidden, including the menu bar. Elements do not automatically show themselves in response to mouse movements or user activity.

4

All suppressed mode. In this mode, all UI elements are hidden, including the menu bar. UI elements may show themselves automatically in response to mouse movements or other user activity. This option is available only in Mac OS X 10.3 and later.

LSVisibleInClassic

LSVisibleInClassic (String - Mac OS X). If this key is set to “1”, any agent applications or background-only applications with this key appears as background-only processes to the Classic environment. Agent applications and background-only applications without this key do not appear as running processes to Classic at all. Unless your process needs to communicate explicitly with a Classic application, you do not need to include this key.

MinimumOSVersion

MinimumOSVersion (String - iOS, Mac OS X). When you build an iOS application, Xcode notes the target OS (as determined by the Base SDK selection) as the MinimumOSVersion property. Do not specify this property yourself in the Info.plist file; it is a system-written property. When you publish your application to the App Store, the store indicates the iOS release on which your application can run based on this property. It is equivalent to the LSMinimumSystemVersion property on Mac OS X.




Last updated: 2010-07-08

Did this document help you? Yes It's good, but... Not helpful...