Usage
Description
Launches an application by name or bundle ID and waits until its window appears on screen. This command is idempotent — if the app is already running, it will be activated and its window brought to the front.Parameters
Application name (e.g., “Safari”) or bundle ID (e.g., “com.apple.Safari”)
Maximum time in milliseconds to wait for the window to appear
Response
Returns aWindowInfo object for the launched application’s window:
Response Fields
id— Unique window identifier for use with window management commandstitle— Current window titleapp_name— Application namepid— Process IDis_focused— Whether this window currently has focusbounds— Window position and size (optional)
Examples
Launch by application name
Launch by bundle ID
Launch with custom timeout
Launch and verify in script
Error Codes
APP_NOT_FOUND— Application does not exist on the systemTIMEOUT— Application did not show a window within the timeout periodINTERNAL— System error during launch
Notes
- The command waits for a visible window — apps that launch without windows (e.g., menu bar apps) may timeout
- On macOS, requires Accessibility permission
- If the app is already running, it will be activated instead of launching a new instance