Silk Mobile

Table of Contents (Homepage)

Launch

void Launch (activity, instrument, Stop if run)

images/images/os-icons/os_ios_150x150.png

images/images/os-icons/os_android_150x150.png

images/images/os-icons/os_windows_150x150.png

images/images/os-icons/os_blackberry_150x150.png

Description

Launch activity (application) or navigate to given URL during runtime.

Parameters

  • Activity: The application main activity (the application to be launched).

  • OR a URL page.

  • Instrument: Boolean

    • True: Will launch the app in instrumented mode.

    • False: Will launch the app in instrumented mode.

  • Stop if run - Boolean

    • True: Will kill the application if it is on the background before reluanch

Usage

In the following example we will launch the imdb application on the android device

Application is available on the application manager.

Device before:

images/download/attachments/3309586/4.jpg

Parameters:

images/download/attachments/3309586/5.jpg

Result:

Now you can click the object spy as the application is instrumented

images/download/attachments/3309586/6.jpg images/download/attachments/3309586/7.jpg

Code Examples

Java Example
client.launch("com.imdb.mobile/.Home", true, true);
C# Example
client.Launch("com.imdb.mobile/.Home", true, true);
VBScript Example
client.Launch "com.imdb.mobile/.Home", true, true
Python Example
self.client.launch("com.imdb.mobile/.Home", True, True)
Perl Example
$client->launch("com.imdb.mobile/.Home", 1, 1);