Launch
Description
Use this command to launch applications in run time.
Parameters
Name | Type | Description |
---|---|---|
BundleId (iOS) / Application Activity (Android) | string | Application to be launched |
Instrument | boolean | * True - Instrumented * False - Non-instrumented |
stopIfRunning | boolean | * True - Stops the app if it is running * False - Do not stop the app but simply bring it forward |
In Appium Grid, if you want to launch with with Instrument set to True, make sure that the context is set to instrumented first. To do this, do one of the following:
-
Add
driver.context("NATIVE_APP_INSTRUMENTED")
beforelaunch
. -
Use
driver.setCapability("appInstrumented", "true")
. Otherwise, Appium grid throws an error and launch fails.
Use Case
After using the install command, you would want to launch the app anytime during the test. Note that the launch command complements the install command but does not rely on it. The launch command lets you launch any application given that you know the BundleID (iOS), or App Package and App Main Activity (Android).
Example
Replace <server> with the appropriate URL.
- Public Continuous Testing Cloud - https://cloud.seetest.io/wd/hub/.
- Dedicated Continuous Testing Cloud environment - Your own domain. For example: https://company.experitest.com/wd/hub/
- On-premises Continuous Testing Cloud environment - Your designated URL. For example: https://company.com/wd/hub
Usage of Launch Command
driver = new IOSDriver(new URL("<server>"), dc);
seetest = new SeeTestClient(driver);
...
seetest.launch("com.apple.mobilesms", false, false);
iOS Native Bundle IDs
iOS Native Bundle IDs Expand source
App Name | Bundle ID
---------------------------------
App Store | com.apple.AppStore
Calculator | com.apple.calculator
Calendar | com.apple.mobilecal
Camera | com.apple.camera
Clock | com.apple.mobiletimer
Compass | com.apple.compass
Contacts | com.apple.MobileAddressBook
FaceTime | com.apple.facetime
Files | com.apple.DocumentsApp
Find Friends| com.apple.mobileme.fmf1
Find iPhone | com.apple.mobileme.fmip1
Health | com.apple.health
Home | com.apple.Home
iBooks | com.apple.iBooks
iCloud Drive| com.apple.iclouddriveapp
iTunes Store| com.apple.MobileStore
Mail | com.apple.mobilemail
Maps | com.apple.Maps
Messages | com.apple.mobilesms
Music | com.apple.Music
News | com.apple.news
Notes | com.apple.mobilenotes
Phone | com.apple.mobilephone
Photos | com.apple.mobileslideshow
Photo Booth | com.apple.Photo-Booth
Podcasts | com.apple.podcasts
Reminders | com.apple.reminders
Safari | com.apple.mobilesafari
Settings | com.apple.Preferences
Stocks | com.apple.stocks
Tips | com.apple.tips
TV | com.apple.tv
Videos | com.apple.videos
Voice Memos | com.apple.voicememos
Wallet | com.apple.passbook
Watch | com.apple.bridge
Weather | com.apple.weather
iOS Settings URLs
Launching specific sections of the Settings app (com.apple.Preferences).
Launching Specific Settings Sections
driver = new IOSDriver(new URL("<server>"), dc);
seetest = new SeeTestClient(driver);
seetest.launch("com.apple.Preferences/App-prefs:General", false, false); // example-1: Will launch Settings --> General
seetest.launch("com.apple.Preferences/App-prefs:SAFARI", false, false); // example-2: Will launch Settings --> Safari
seetest.launch("com.apple.Preferences/App-prefs:com.experitest.UICatalog", false, false); // example-3: Will launch Settings --> UICatalog's settings
Additional URL settings can be found here - Settings URLs
This is not supported in iOS 18 beta devices.
Android
For Android it is a bit harder to get the full list and launching the app also requires the app activity. You can use APK Info app for that purpose.