[Mobile] Start Existing Application


This is a companion discussion topic for the original entry at https://docs.katalon.com/katalon-studio/docs/mobile-keyword-start-existing-apps.html

I’m not able to use Mobile.startExistingApplication feature of the new Katalon v.6.3.0. I’ve tried the following:

  1. Spying on an installed application on an android device
  2. Recording on an installed application on an android device
  3. Running test case with Mobile.startExistingApplication(“package_name”)

And all of them ends in this step:
[35m[UiAutomator2]e[39m Server packages are not going to be (re)installed

I can neither record nor spy or run test cases. It always stuck here “Server packages are not going to be (re)installed”

Any help will be highly appreciated!

OS: Windows 10
Katalon ver: 6.3.0
node ver: 10.16.0
npm ver: 6.9.0
appium ver: 1.14.0

Let me know if you require any further information.
FYI I also have the Katalon v6.2.2 in the same folder. I don’t if this can be the root cause by any chance.

Yes, we have same issues.

I wonder if this issues has been fixed in 6.3.2 version.

Hi @khadapynurhuda,

Please show the the full stack-trace log and some screenshots.

Thanks

Hi @duyluong,

I would like to recording and of course, startExistingApplication using Application ID.

Here is my screenshot.

It’s stopped here and only loading here.

Thanks.

Hi! I don’t know why, but I managed to make it work only on Android Emulator, on physical device I can’t use startExistingApplication feature.

1 Like

Not working for me either choosing application ID option in the recorder.
here is the log:


using emulator Bluestacks
Appium v. 1.13.0
Katalon v. 6.3.3

Any idea what can be ? Thanks.

Please use this on android verision 6.0 devices. It is working.

well, thanks.
which means it doesn’t work in android 5 below?

I am trying to use it on iPhone, real device, but it is not working. Is it possible to use it on iOS devices?
The App I am trying to start is uninstalled when I run the test.

iPhone SE iOS 11.0.3
Katalon 6.3.1
Appium 1.13.0

I found out the problem.
It worked after removing the app capability from Project Settings>Desired Capabilities>Mobile>iOS

Hi how did you manage to make it work in emulator, Im using Bluestacks and i cant make it work.

I’ve used Android 7.0 and 8.0
It can’t working as well.

I am trying with Android real device (Samsung S8) and it is not working. ÂżAny advice?

Windows 10
npm 6.9.0
Appium 1.14.2
Katalon 6.3.3
Android 8.0

Hi @Katalon_team,

I am not able to start existing application with application ID when I try to spy or record existing apps in real android device (Xiaomi Redmi 5 Plus Android 8.1.0). My environment specs are:

  • Windows 10 Pro
  • Katalon version 7.2.6

Bellow is the full log I received:
e[35m[Appium]e[39m Welcome to Appium v1.14.2
e[35m[Appium]e[39m Non-default server args:
e[35m[Appium]e[39m port: 50499
e[35m[Appium]e[39m loglevel: info
e[35m[Appium]e[39m chromeDriverPort: 50500
e[35m[Appium]e[39m tmpDir: C:\Users\kiki\AppData\Local\Temp\Katalon\Appium\Temp1583371388643
e[35m[Appium]e[39m Appium REST http interface listener started on 0.0.0.0:50499
e[35m[HTTP]e[39m e[37m–>e[39m e[37mGETe[39m e[37m/wd/hub/statuse[39m
e[35m[HTTP]e[39m e[90m{}e[39m
e[35m[HTTP]e[39m e[37m<-- GET /wd/hub/status e[39me[32m200e[39m e[90m11 ms - 68e[39m
e[35m[HTTP]e[39m e[90me[39m
e[35m[HTTP]e[39m e[37m–>e[39m e[37mGETe[39m e[37m/wd/hub/statuse[39m
e[35m[HTTP]e[39m e[90m{}e[39m
e[35m[HTTP]e[39m e[37m<-- GET /wd/hub/status e[39me[32m200e[39m e[90m2 ms - 68e[39m
e[35m[HTTP]e[39m e[90me[39m
e[35m[HTTP]e[39m e[37m–>e[39m e[37mPOSTe[39m e[37m/wd/hub/sessione[39m
e[35m[HTTP]e[39m e[90m{“desiredCapabilities”:{“appPackage”:“com.android.settings”,“appWaitActivity”:"",“deviceId”:“c85ac29c9805”,“deviceName”:“Xiaomi Redmi 5 Plus (Android 8.1.0)”,“platform”:“ANDROID”,“appActivity”:".Settings",“newCommandTimeout”:1800,“platformVersion”:“8.1.0”,“automationName”:“uiautomator2”,“autoGrantPermissions”:true,“platformName”:“Android”,“udid”:“c85ac29c9805”,“systemPort”:8292},“capabilities”:{“firstMatch”:[{“appium:appActivity”:".Settings",“appium:appPackage”:“com.android.settings”,“appium:appWaitActivity”:"",“appium:autoGrantPermissions”:true,“appium:automationName”:“uiautomator2”,“deviceId”:“c85ac29c9805”,“appium:deviceName”:“Xiaomi Redmi 5 Plus (Android 8.1.0)”,“appium:newCommandTimeout”:1800,“platform”:“ANDROID”,“platformName”:“android”,“appium:platformVersion”:“8.1.0”,“appium:systemPort”:8292,“appium:udid”:“c85ac29c9805”}]}}e[39m
e[35m[BaseDriver]e[39m The capabilities [“deviceId”,“platform”] are not standard capabilities and should have an extension prefix
e[35m[Appium]e[39m Appium v1.14.2 creating new AndroidUiautomator2Driver (v1.33.1) session
e[35m[Appium]e[39m Capabilities:
e[35m[Appium]e[39m deviceId: c85ac29c9805
e[35m[Appium]e[39m platform: ANDROID
e[35m[Appium]e[39m platformName: android
e[35m[Appium]e[39m appActivity: .Settings
e[35m[Appium]e[39m appPackage: com.android.settings
e[35m[Appium]e[39m appWaitActivity: *
e[35m[Appium]e[39m autoGrantPermissions: true
e[35m[Appium]e[39m automationName: uiautomator2
e[35m[Appium]e[39m deviceName: Xiaomi Redmi 5 Plus (Android 8.1.0)
e[35m[Appium]e[39m newCommandTimeout: 1800
e[35m[Appium]e[39m platformVersion: 8.1.0
e[35m[Appium]e[39m systemPort: 8292
e[35m[Appium]e[39m udid: c85ac29c9805
e[35m[BaseDriver]e[39m The following capabilities were provided, but are not recognized by Appium:
e[35m[BaseDriver]e[39m deviceId
e[35m[BaseDriver]e[39m platform
e[35m[BaseDriver]e[39m Session created with session id: aedf1db3-d0eb-4b8b-8240-4775e7865acc
e[35m[ADB]e[39m Found 1 ‘build-tools’ folders under ‘C:\Users\kiki.katalon\tools\android_sdk’ (newest first):
e[35m[ADB]e[39m C:/Users/kiki/.katalon/tools/android_sdk/build-tools/29.0.3
e[35m[ADB]e[39m Using ‘adb.exe’ from ‘C:\Users\kiki.katalon\tools\android_sdk\platform-tools\adb.exe’
e[35m[AndroidDriver]e[39m Retrieving device list
e[35m[AndroidDriver]e[39m Using device: c85ac29c9805
e[35m[ADB]e[39m Using ‘adb.exe’ from ‘C:\Users\kiki.katalon\tools\android_sdk\platform-tools\adb.exe’
e[35m[AndroidDriver]e[39m No app sent in, not parsing package/activity
e[35m[ADB]e[39m Using ‘aapt.exe’ from ‘C:\Users\kiki.katalon\tools\android_sdk\build-tools\29.0.3\aapt.exe’
e[35m[ADB]e[39m Using ‘apksigner.bat’ from ‘C:\Users\kiki.katalon\tools\android_sdk\build-tools\29.0.3\apksigner.bat’
e[35m[UiAutomator2]e[39m Server packages are not going to be (re)installed

it stuck there. Thanks for the help!

Hi @Katalon_team,

I got some error when I tried to run the katalon

and I already add several setting on project setting

node: v.13.8.0
npm: v.6.13.7
appium: v.1.16.0
Katalon: v.7.2.1
OS: Catalina 10.15.3
Android: 8.0.0

Thanks

In my case, when I run startExistingApplication(“com.mypackage”), in my android machine, it open “Android setting” screen, and there was no more action happens.
Is there anyone get the same problem with me, could you advise me on it?

1 Like

@duyluong @Katalon_team

I’m unable to start existing android application. Here is the error.

Unable to start app with application ID: ‘com.maestrohealth.mbenefits.uat’ (Root cause: org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Cannot activate ‘com.maestrohealth.mbenefits.uat’. Original error: Error executing adbExec. Original error: ‘Command ‘/Users/dileepvalgote/.katalon/tools/android_sdk/platform-tools/adb -P 5037 -s 2030018020042145 shell monkey -p com.maestrohealth.mbenefits.uat -c android.intent.category.LAUNCHER 1’ exited with code 252’; Stderr: 'args: [-p, com.maestrohealth.mbenefits.uat, -c, android.intent.category.LAUNCHER, 1]

arg: “-p”

arg: “com.maestrohealth.mbenefits.uat”

arg: “-c”

arg: “android.intent.category.LAUNCHER”

arg: “1”

data=“com.maestrohealth.mbenefits.uat”

data=“android.intent.category.LAUNCHER”’; Code: ‘252’

Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:25:53’

System info: host: ‘Dileep-Valgotes-MacBook-Pro.local’, ip: ‘2601:249:1500:c490:0:0:0:c265%en0’, os.name: ‘Mac OS X’, os.arch: ‘x86_64’, os.version: ‘10.15.5’, java.version: ‘1.8.0_181’

Driver info: com.kms.katalon.core.appium.driver.SwipeableAndroidDriver

Capabilities {appActivity: .Settings, appPackage: com.android.settings, autoGrantPermissions: true, automationName: uiautomator2, chromedriverPort: 57875, databaseEnabled: false, desired: {appActivity: .Settings, appPackage: com.android.settings, autoGrantPermissions: true, automationName: uiautomator2, chromedriverPort: 57875, deviceName: BLU S5 (Android 8.1.0), newCommandTimeout: 1800, platform: ANDROID, platformName: android, platformVersion: 8.1.0, systemPort: 8267, udid: 2030018020042145}, deviceApiLevel: 27, deviceManufacturer: BLU, deviceModel: S5, deviceName: 2030018020042145, deviceScreenDensity: 360, deviceScreenSize: 720x1280, deviceUDID: 2030018020042145, javascriptEnabled: true, locationContextEnabled: false, networkConnectionEnabled: true, newCommandTimeout: 1800, pixelRatio: 2.25, platform: ANDROID, platformName: Android, platformVersion: 8.1.0, statBarHeight: 54, systemPort: 8267, takesScreenshot: true, udid: 2030018020042145, viewportRect: {height: 1118, left: 0, top: 54, width: 720}, warnings: {}, webStorageEnabled: false}

Session ID: 9ec86737-07eb-4dd8-a375-a9578c438185

at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:187)

at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:122)

at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49)

at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158)

at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:239)

at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)

at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42)

at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)

at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1)

at com.kms.katalon.core.appium.driver.SwipeableAndroidDriver.execute(SwipeableAndroidDriver.java:1)

at io.appium.java_client.CommandExecutionHelper.execute(CommandExecutionHelper.java:27)

at io.appium.java_client.InteractsWithApps.activateApp(InteractsWithApps.java:165)

at io.appium.java_client.InteractsWithApps.activateApp(InteractsWithApps.java:149)

at io.appium.java_client.InteractsWithApps$activateApp.call(Unknown Source)

at com.kms.katalon.core.mobile.keyword.builtin.StartExistingApplicationKeyword$_startApplication_closure1.doCall(StartExistingApplicationKeyword.groovy:41)

at com.kms.katalon.core.mobile.keyword.builtin.StartExistingApplicationKeyword$_startApplication_closure1.doCall(StartExistingApplicationKeyword.groovy)

at com.kms.katalon.core.mobile.keyword.internal.MobileKeywordMain.runKeyword(MobileKeywordMain.groovy:21)

at com.kms.katalon.core.mobile.keyword.internal.MobileKeywordMain$runKeyword.call(Unknown Source)

at com.kms.katalon.core.mobile.keyword.builtin.StartExistingApplicationKeyword.startApplication(StartExistingApplicationKeyword.groovy:43)

at com.kms.katalon.core.mobile.keyword.builtin.StartExistingApplicationKeyword.execute(StartExistingApplicationKeyword.groovy:34)

at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:73)

at com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords.startExistingApplication(MobileBuiltInKeywords.groovy:89)

at com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords$startExistingApplication.call(Unknown Source)

at Login.run(Login:10)

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:339)

at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:330)

at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:309)

at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:301)

at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:235)

at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:114)

at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:105)

at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)

at TempTestCase1606162847654.run(TempTestCase1606162847654.groovy:25)

)

Hi @dvalgote,

Please plug your device and run this command in terminal:

/Users/dileepvalgote/.katalon/tools/android_sdk/platform-tools/adb  shell monkey -p com.maestrohealth.mbenefits.uat -c android.intent.category.LAUNCHER

and share the command result here.

Would also like to verify this isn’t working for me for KSE 7.9.1:
Appium: 1.15
Mobile OS: Android 7
Windows OS: Windows 10

1 Like