Page tree
Skip to end of metadata
Go to start of metadata

Description

The command allows you to launch applications in run time.

Parameters

Name

Value

Description

BundleId (iOS) / Application Activity (Android)stringThe app to be launched
Instrumentboolean

true - instrumented

false - non-instrumented

stopIfRunningboolean

true - will stop the app if it was already running
false - will not stop the app but will simply bring it forward

In Appium Grid, If user wants to launch with Instrument=true, he/she has to make sure that the context is set to instrumented first. There are 2 options to do that :- 

  1. Adding driver.context(“NATIVE_APP_INSTRUMENTED") command before launch command

  2. Using driver.setCapability(“appInstrumented”, “true”)

If user doesn't use any of the above mentioned option and launched with Instrument=trueappium grid will throw an error and launch will fail

Usage

Following 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

Set Experitest Url

Please make sure you replace <EXPERITEST_URL> with appropriate URL in the code snippet below.

Usage of Launch Command
driver = new IOSDriver(new URL("<EXPERITEST_URL>"), dc);
seetest = new SeeTestClient(driver);


...
...


//your app sends a verification code to the user's phone. 
//You can launch the Native iOS SMS app to retrieve the code.
seetest.launch("com.apple.mobilesms", false, false);


See below for a full list of native iOS and Android apps:

iOS

List of iOS Native Bundle IDs
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


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.


  • No labels