# How to launch an installed app using Katalon Studio

**URL:** <https://forum.katalon.com/t/how-to-launch-an-installed-app-using-katalon-studio/15468>\
**Category:** Mobile Testing\
**Tags:** mobile-testing, katalon-studio\
**Created:** [December 14, 2018, 12:48am UTC](https://forum.katalon.com/t/how-to-launch-an-installed-app-using-katalon-studio/15468 "2018-12-14T00:48:47Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![girija\_aj](https://avatars.discourse-cdn.com/v4/letter/g/919ad9/32.png) [@girija\_aj](https://forum.katalon.com/u/girija_aj)\
**Post date:** [December 14, 2018, 12:48am UTC](https://forum.katalon.com/t/how-to-launch-an-installed-app-using-katalon-studio/15468/1 "2018-12-14T00:48:47Z")

</div>

Hi,  
I have developed simple app hello world. I want to open that app when i launch my Katalon project and then click on button.  
It is possible to do that using katalon studio?

thanks  
–girija

---

<div class="post-metadata">

**Author:** ![devalex88](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/devalex88/32/336_2.png) [@devalex88](https://forum.katalon.com/u/devalex88)\
**Post date:** [December 14, 2018, 8:25am UTC](https://forum.katalon.com/t/how-to-launch-an-installed-app-using-katalon-studio/15468/2 "2018-12-14T08:25:03Z")

</div>

Did you mean mobile app? Generally, the answer is “Yes”. We need more information about your app, though.

---

<div class="post-metadata">

**Author:** ![girija\_aj](https://avatars.discourse-cdn.com/v4/letter/g/919ad9/32.png) [@girija\_aj](https://forum.katalon.com/u/girija_aj)\
**Post date:** [December 17, 2018, 5:52pm UTC](https://forum.katalon.com/t/how-to-launch-an-installed-app-using-katalon-studio/15468/3 "2018-12-17T17:52:10Z")

</div>

Yes i am mobile app. It is a Android app. Its a third party app so i don’t have access to code. It performs certain operations after clicking on those buttons.

---

<div class="post-metadata">

**Author:** ![girija\_aj](https://avatars.discourse-cdn.com/v4/letter/g/919ad9/32.png) [@girija\_aj](https://forum.katalon.com/u/girija_aj)\
**Post date:** [January 3, 2019, 12:16am UTC](https://forum.katalon.com/t/how-to-launch-an-installed-app-using-katalon-studio/15468/4 "2019-01-03T00:16:28Z")

</div>

Suppose I write hello world Mobile app and i need to open that when i start my testing. Take example google map when i run my test project I have device connected and i need to start the map app which in on Android mobile

---

<div class="post-metadata">

**Author:** ![Zarashima](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/zarashima/32/928_2.png) [@Zarashima](https://forum.katalon.com/u/Zarashima)\
**Post date:** [January 3, 2019, 2:24pm UTC](https://forum.katalon.com/t/how-to-launch-an-installed-app-using-katalon-studio/15468/5 "2019-01-03T14:24:22Z")

</div>

You can do it if you know `appPackage` and `appActivty` desired capabilities of your app. These coupled capabilities used to identify the application in your device. There links will provide you an approach to get it:

> **[2 Ways to find appPackage and appActivity name of your App -...](http://www.automationtestinghub.com/apppackage-and-appactivity-name/)**
>
> This article helps you identify appPackage and appActivity names using either a) adb commands in command prompt or b) by using APK Info app

> **[Tools QA - Page Not Found](https://toolsqa.com/mobile-automation/appium/how-to-find-apppackage-and-appactivity-for-apk-file/)**

Once you have this information, you need to build your own set of Appium desired capabilities and then use Katalon built-in interface to translate that session into Katalon-like session (Appium based of course).

Here is how this approach can be applied with Kobiton devices, of course it can be applied for local devices as well due to being the same context:  
[https://docs.katalon.com/katalon-studio/docs/use-additional-desired-capabilities-for-kobiton-devices.html](https://docs.katalon.com/katalon-studio/docs/use-additional-desired-capabilities-for-kobiton-devices.html)

---

<div class="post-metadata">

**Author:** ![girija\_aj](https://avatars.discourse-cdn.com/v4/letter/g/919ad9/32.png) [@girija\_aj](https://forum.katalon.com/u/girija_aj)\
**Post date:** [January 3, 2019, 5:52pm UTC](https://forum.katalon.com/t/how-to-launch-an-installed-app-using-katalon-studio/15468/6 "2019-01-03T17:52:49Z")

</div>

Vinh thanks for the response. I will check it out and let you know how did it go.

---

<div class="post-metadata">

**Author:** ![girija\_aj](https://avatars.discourse-cdn.com/v4/letter/g/919ad9/32.png) [@girija\_aj](https://forum.katalon.com/u/girija_aj)\
**Post date:** [January 5, 2019, 2:09am UTC](https://forum.katalon.com/t/how-to-launch-an-installed-app-using-katalon-studio/15468/7 "2019-01-05T02:09:52Z")

</div>

Hi Vinh

I am not able to find how to use appPackage and appActivity. I know using Android studio but I am not sure how to use here in Katalon. I didn’t find any example. I did looked at the both the links you sent but did not work for me. Do you have any other suggestion?

---

<div class="post-metadata">

**Author:** ![Zarashima](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/zarashima/32/928_2.png) [@Zarashima](https://forum.katalon.com/u/Zarashima)\
**Post date:** [January 6, 2019, 3:57am UTC](https://forum.katalon.com/t/how-to-launch-an-installed-app-using-katalon-studio/15468/8 "2019-01-06T03:57:06Z")

</div>

I will provide to you an example soon 🙂

---

<div class="post-metadata">

**Author:** ![Zarashima](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/zarashima/32/928_2.png) [@Zarashima](https://forum.katalon.com/u/Zarashima)\
**Post date:** [January 6, 2019, 11:27am UTC](https://forum.katalon.com/t/how-to-launch-an-installed-app-using-katalon-studio/15468/9 "2019-01-06T11:27:03Z")

</div>

Hi there,

Attached is the sample project using the same approach I’ve given before. Before jumping into this project, make sure you read our approach carefully to understand why do we need to define these own capabilities by yourself, and have a brief read about [Appium architecture](https://www.toolsqa.com/mobile-automation/appium/appium-a-cross-platform-mobile-automation-tool/)

Looking at this project, some things to be noticed:

- Appium is started manually with the help of `AppiumServer` utilitiy, and of course it will be terminated right after test execution. For the current instance of this project, these setup and teardown steps are placed on `Listeners` script.
- The actual custom keyword is: `startInstalledApplication` in `com.mobile.keywords` package. Since Android and iOS are different mobile types, I separate them conditionally. This keyword also initialize necessary capabilities to start installed application (using `appPackage` and `appAcvitity` capabilities) in the current device through `deviceInformation` parameter.

Now let’s move on why we need to do this:

- When using `Start Application` built-in keyword, Katalon Studio will automatically start an Appium server using **random** port. We need a static port here to hook into.
- Starting installed application requires us to build Appium desired capabilities from scratch, so `startInstalledApplication` will do all these things.

References to get capabilities:

> **[Tools QA - Page Not Found](https://www.toolsqa.com/mobile-automation/appium/how-to-find-apppackage-and-appactivity-for-apk-file/)**

[http://appium.io/docs/en/writing-running-appium/caps/](http://appium.io/docs/en/writing-running-appium/caps/)

Usage in the test case `Test Cases/Verify Correct Alarm Message`:

- Local variables should be created to define necessary capabilities:  
 ![Screenshot_5](https://europe1.discourse-cdn.com/katalon/original/1X/2bf3a93be555e3d25cd84f747678a7b11fabc5a8.png)
- In the test script, just replace `Start Application` keyword with the custom keyword along with its method signature:  
`//Mobile.startApplication(appPath, false) CustomKeywords.'com.mobile.keywords.ApplicationBehavior.startInstalledApplication'("Android", deviceInformation, appPackage, appActivity)`  
=\> Once Test Suite execution happens (because my `Listeners` script belongs to Test Suite execution phase), Katalon Studio can start an existing application in the device and further `Mobile` keywords don’t need to be maintained.

This is the most basic implementation to solve ‘How to launch an installed app using Katalon Studio’. Other adjustments can be made to applied for Test Case execution phase based on `Listeners` script.  
[mobile.zip](https://europe1.discourse-cdn.com/katalon/original/1X/8db2736f564047f3d36c6fe97c5476048ed55b17.zip) (2.5 MB)

---

<div class="post-metadata">

**Author:** ![devalex88](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/devalex88/32/336_2.png) [@devalex88](https://forum.katalon.com/u/devalex88)\
**Post date:** [January 6, 2019, 5:07pm UTC](https://forum.katalon.com/t/how-to-launch-an-installed-app-using-katalon-studio/15468/10 "2019-01-06T17:07:44Z")

</div>

The above comment has been reposted as a _Tips and Tricks_ article.

[http://forum.katalon.com/t/start-installed-mobile-application-in-katalon-studio/17178](http://forum.katalon.com/t/start-installed-mobile-application-in-katalon-studio/17178)

---

<div class="post-metadata">

**Author:** ![girija\_aj](https://avatars.discourse-cdn.com/v4/letter/g/919ad9/32.png) [@girija\_aj](https://forum.katalon.com/u/girija_aj)\
**Post date:** [January 22, 2019, 7:07pm UTC](https://forum.katalon.com/t/how-to-launch-an-installed-app-using-katalon-studio/15468/11 "2019-01-22T19:07:09Z")

</div>

I did everything specified in the documents/links above specified but i am getting error:

Test Cases/Verify Correct Alarm Message FAILED.  
Reason:  
java.lang.ClassNotFoundException: com.mobile.keywords.ApplicationBehavior  
at com.kms.katalon.core.main.CustomKeywordDelegatingMetaClass.getCustomKeywordClassAndSetMetaClass(CustomKeywordDelegatingMetaClass.java:98)  
at com.kms.katalon.core.main.CustomKeywordDelegatingMetaClass.invokeStaticMethod(CustomKeywordDelegatingMetaClass.java:44)  
at Verify Correct Alarm Message.run(Verify Correct Alarm Message:25)  
at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)  
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)  
at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:328)  
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:319)  
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:298)  
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:290)  
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:224)  
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:106)  
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:97)  
at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)  
at TempTestCase1547858698156.run(TempTestCase1547858698156.groovy:22)

---

<div class="post-metadata">

**Author:** ![girija\_aj](https://avatars.discourse-cdn.com/v4/letter/g/919ad9/32.png) [@girija\_aj](https://forum.katalon.com/u/girija_aj)\
**Post date:** [January 22, 2019, 7:14pm UTC](https://forum.katalon.com/t/how-to-launch-an-installed-app-using-katalon-studio/15468/12 "2019-01-22T19:14:06Z")

</div>

Here is my test case:

import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase  
import static com.kms.katalon.core.testdata.TestDataFactory.findTestData  
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject  
import internal.GlobalVariable as GlobalVariable  
import com.kms.katalon.core.configuration.RunConfiguration as RunConfiguration  
import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile  
import com.kms.katalon.core.util.internal.PathUtil as PathUtil  
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI  
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS  
import static com.kms.katalon.core.checkpoint.CheckpointFactory.findCheckpoint  
import com.kms.katalon.core.model.FailureHandling as FailureHandling  
import com.kms.katalon.core.testcase.TestCase as TestCase  
import com.kms.katalon.core.testdata.TestData as TestData  
import com.kms.katalon.core.testobject.TestObject as TestObject  
import com.kms.katalon.core.checkpoint.Checkpoint as Checkpoint

Mobile.comment(‘Story: Verify correct alarm message’)

Mobile.comment(‘Given that user has started an application’)

‘Get full directory’s path of android application’  
def appPath = PathUtil.relativeToAbsolutePath(GlobalVariable.G\_AndroidApp, RunConfiguration.getProjectDir())

[//Mobile.startApplication](https://Mobile.startApplication)(appPath, false)  
CustomKeywords.‘com.mobile.keywords.ApplicationBehavior.startInstalledApplication’(“Android”, deviceInformation, appPackage, appActivity)

/\*  
Mobile.comment(‘And he navigates the application to Activity form’)

Mobile.tap(findTestObject(‘Application/android.widget.TextView - App’), 10)

Mobile.tap(findTestObject(‘Application/App/android.widget.TextView-Activity’), 10)

Mobile.comment(‘When he taps on the Custom Dialog button’)

Mobile.tap(findTestObject(‘Application/App/Activity/android.widget.TextView-Custom Dialog’), 10)

‘Get displayed message on the dialog’  
def message = Mobile.getText(findTestObject(‘Application/App/Activity/Custom Dialog/android.widget.TextViewCustomDialog’),  
10)

Mobile.comment(‘Then the correct dialog message should be displayed’)

Mobile.verifyEqual(message, ‘Example of how you can use a custom Theme.Dialog theme to make an activity that looks like a customized dialog, here with an ugly frame.’)

\*/  
Mobile.closeApplication()

---

<div class="post-metadata">

**Author:** ![GeneralChingChicken](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/generalchingchicken/32/1398_2.png) [@GeneralChingChicken](https://forum.katalon.com/u/GeneralChingChicken)\
**Post date:** [January 24, 2019, 6:23am UTC](https://forum.katalon.com/t/how-to-launch-an-installed-app-using-katalon-studio/15468/13 "2019-01-24T06:23:19Z")

</div>

Yes mobile App

---

<div class="post-metadata">

**Author:** ![Chris\_Trevarthen](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/chris_trevarthen/32/358_2.png) [@Chris\_Trevarthen](https://forum.katalon.com/u/Chris_Trevarthen)\
**Post date:** [January 28, 2019, 10:19pm UTC](https://forum.katalon.com/t/how-to-launch-an-installed-app-using-katalon-studio/15468/14 "2019-01-28T22:19:51Z")

</div>

Hi @girija_aj,

From your error message, it looks like your test can’t find the `com.mobile.keywords.ApplicationBehavior` class.  
Can you verify that you see it when expanding your Tests Explorer, like this:

 ![21%20PM](https://europe1.discourse-cdn.com/katalon/original/2X/1/11e79435be3526f7b0689ffce7765306a771d10d.png)

If not, you should download @Zarashima’s [mobile.zip](https://europe1.discourse-cdn.com/katalon/uploads/default/uploads/default/original/1X/8db2736f564047f3d36c6fe97c5476048ed55b17.zip) file from above and copy the `Keywords` folder into your own test’s `Keywords` folder.

Hope this helps,

Chris

---

<div class="post-metadata">

**Author:** ![ouknam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/ouknam/32/23869_2.png) [@ouknam](https://forum.katalon.com/u/ouknam)\
**Post date:** [March 22, 2019, 9:54am UTC](https://forum.katalon.com/t/how-to-launch-an-installed-app-using-katalon-studio/15468/15 "2019-03-22T09:54:18Z")

</div>

Hi,

I have the same problem.  
How can i run your project mobile.zip?

when i run i have only done

---

<div class="post-metadata">

**Author:** ![Chris\_Trevarthen](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/chris_trevarthen/32/358_2.png) [@Chris\_Trevarthen](https://forum.katalon.com/u/Chris_Trevarthen)\
**Post date:** [March 26, 2019, 3:33am UTC](https://forum.katalon.com/t/how-to-launch-an-installed-app-using-katalon-studio/15468/16 "2019-03-26T03:33:44Z")

</div>

Hi @ouknam,

Could you please explain what you’re trying to test, what you’ve tried, and what is going wrong?

If you’re trying to run an existing app on a device or simulator, then this post might help:

> [@How to change desired capabilities during executing the test suit on real android device](http://forum.katalon.com/t/how-to-change-desired-capabilities-during-executing-the-test-suit-on-real-android-device/18385/2):
>
> Hi @zanoon2010, I think you can fake out the test to switch applications by setting the Desired Capabilities, using RunConfiguration.setMobileDriverPreferencesProperty: import com.kms.katalon.core.configuration.RunConfiguration import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile // You will need a real .apk file here in order to launch successfully, even if you're not testing it String appFile = "/fullpathtomyfile/mobile-beta.apk" // The app info for the built-in app y…

Or if you follow the instructions above from this post, you can unzip the mobile.zip file mentioned in the post, then open the `Android Mobile Tests with Katalon Studio.prj` file within it:

> [@How to launch an installed app using Katalon Studio](http://forum.katalon.com/t/how-to-launch-an-installed-app-using-katalon-studio/15468/9):
>
> Hi there, Attached is the sample project using the same approach I’ve given before. Before jumping into this project, make sure you read our approach carefully to understand why do we need to define these own capabilities by yourself, and have a brief read about [Appium architecture](https://www.toolsqa.com/mobile-automation/appium/appium-a-cross-platform-mobile-automation-tool/) Looking at this project, some things to be noticed: Appium is started manually with the help of AppiumServer utilitiy, and of course it will be terminated right after test execution. For the current instance of th…

Hope this helps,

– Chris

---

<div class="post-metadata">

**Author:** ![ppppacchan](https://avatars.discourse-cdn.com/v4/letter/p/c89c15/32.png) [@ppppacchan](https://forum.katalon.com/u/ppppacchan)\
**Post date:** [December 10, 2019, 10:47pm UTC](https://forum.katalon.com/t/how-to-launch-an-installed-app-using-katalon-studio/15468/17 "2019-12-10T22:47:49Z")

</div>

Is there a solution for install ipa file?
