Przejdź do głównej treści

launchApp

Launch or activate an app on the device. If no bundleId (iOS) or appId (Android) is provided, the command will automatically detect and activate the currently active app.

Note: Falls back to the deprecated Appium 2 protocol endpoint if the driver does not support the mobile: execute method.

Usage
browser.launchApp({ bundleId, arguments, environment, appId })
Parameters
NameTypeDetails
options
optional
objectOptions for launching the app (optional)
options.bundleId
optional
stringThe bundle ID of the iOS app to launch. If not provided, the currently active app is used.
iOS-ONLY
options.arguments
optional
string, string[]Command line arguments to pass to the app on launch.
iOS-ONLY
options.environment
optional
objectEnvironment variables to set when launching the app (key-value pairs).
iOS-ONLY
options.appId
optional
stringThe package name of the Android app to activate. If not provided, the currently active app is used.
ANDROID-ONLY
Example
launchApp.js
it('should launch a specific iOS app', async () => {
// iOS: launch a specific app by bundle ID
await browser.launchApp({ bundleId: 'com.example.myapp' })
})
it('should launch an iOS app with arguments and environment', async () => {
// iOS: launch an app and pass arguments and environment variables
await browser.launchApp({
bundleId: 'com.example.myapp',
arguments: ['-AppleLanguages', '(en)'],
environment: { MY_ENV_VAR: 'value' }
})
})
it('should launch a specific Android app', async () => {
// Android: activate/launch a specific app by package name
await browser.launchApp({ appId: 'com.example.myapp' })
})
it('should activate the currently active app', async () => {
// Automatically detect and activate the current app
await browser.launchApp()
})
Support

Support for ios Support for android

uwaga

Refer to the official Appium driver documentation to see which driver versions support this command.

Welcome! How can I help?

WebdriverIO AI Copilot