Spy mobile object failed. some app success if i manually launch app

i need help to check why the spy mobile failed at this point, all app has the same issue.
if i manually launch the app at some app then objects can be spy.
outlook mobile app works if i tap the app manually.
another market app does’t work forever.

[35m[AndroidDriver][39m Screen already unlocked, doing nothing
[35m[UiAutomator2][39m Starting 'com.android.settings/.Settings and waiting for ‘com.nintest.hd13/.Settings’
[35m[UiAutomator2][39m Starting 'com.android.settings/.Settings and waiting for ‘com.nintest.hd13/.Settings’

details:
java.util.concurrent.ExecutionException: org.openqa.selenium.SessionNotCreatedException: Unable to create a new remote session. Please check the server log for more details. Original error: An unknown server-side error occurred while processing the command. Original error: Cannot start the ‘com.android.settings’ application. Visit appium/activity-startup.md at master · appium/appium · GitHub for troubleshooting. Original error: Error executing adbExec. Original error: ‘Command ‘C:\Users\tester\.katalon\tools\android_sdk\platform-tools\adb.exe -P 5037 -s K5J0220528005539 shell am start -W -n com.android.settings/.Settings -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000’ timed out after 30000ms’. Try to increase the 30000ms adb execution timeout represented by ‘adbExecTimeout’ capability
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:25:53’
System info: host: ‘LAPTOP-7932I49J’, ip: ‘192.168.48.1’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_181’
Driver info: driver.version: SwipeableAndroidDriver
remote stacktrace: UnknownError: An unknown server-side error occurred while processing the command. Original error: Cannot start the ‘com.android.settings’ application. Visit appium/activity-startup.md at master · appium/appium · GitHub for troubleshooting. Original error: Error executing adbExec. Original error: ‘Command ‘C:\Users\tester\.katalon\tools\android_sdk\platform-tools\adb.exe -P 5037 -s K5J0220528005539 shell am start -W -n com.android.settings/.Settings -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000’ timed out after 30000ms’. Try to increase the 30000ms adb execution timeout represented by ‘adbExecTimeout’ capability
at getResponseForW3CError (C:\Users\tester\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\errors.js:804:9)
at asyncHandler (C:\Users\tester\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\protocol.js:384:37)
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:25:53’
System info: host: ‘LAPTOP-7932I49J’, ip: ‘192.168.48.1’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_181’
Driver info: driver.version: SwipeableAndroidDriver
at com.kms.katalon.composer.components.impl.dialogs.ProgressMonitorDialogWithThread.runAndWait(ProgressMonitorDialogWithThread.java:49)
at com.kms.katalon.composer.mobile.objectspy.components.MobileLocalAppComposite$12.run(MobileLocalAppComposite.java:474)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:119)
Caused by: org.openqa.selenium.SessionNotCreatedException: Unable to create a new remote session. Please check the server log for more details. Original error: An unknown server-side error occurred while processing the command. Original error: Cannot start the ‘com.android.settings’ application. Visit appium/activity-startup.md at master · appium/appium · GitHub for troubleshooting. Original error: Error executing adbExec. Original error: ‘Command ‘C:\Users\tester\.katalon\tools\android_sdk\platform-tools\adb.exe -P 5037 -s K5J0220528005539 shell am start -W -n com.android.settings/.Settings -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000’ timed out after 30000ms’. Try to increase the 30000ms adb execution timeout represented by ‘adbExecTimeout’ capability
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:25:53’
System info: host: ‘LAPTOP-7932I49J’, ip: ‘192.168.48.1’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_181’
Driver info: driver.version: SwipeableAndroidDriver
remote stacktrace: UnknownError: An unknown server-side error occurred while processing the command. Original error: Cannot start the ‘com.android.settings’ application. Visit appium/activity-startup.md at master · appium/appium · GitHub for troubleshooting. Original error: Error executing adbExec. Original error: ‘Command ‘C:\Users\tester\.katalon\tools\android_sdk\platform-tools\adb.exe -P 5037 -s K5J0220528005539 shell am start -W -n com.android.settings/.Settings -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000’ timed out after 30000ms’. Try to increase the 30000ms adb execution timeout represented by ‘adbExecTimeout’ capability
at getResponseForW3CError (C:\Users\tester\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\errors.js:804:9)
at asyncHandler (C:\Users\tester\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\protocol.js:384:37)
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:25:53’
System info: host: ‘LAPTOP-7932I49J’, ip: ‘192.168.48.1’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_181’
Driver info: driver.version: SwipeableAndroidDriver
at io.appium.java_client.remote.AppiumCommandExecutor$1.createSession(AppiumCommandExecutor.java:208)
at io.appium.java_client.remote.AppiumCommandExecutor.createSession(AppiumCommandExecutor.java:217)
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 org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:213)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:131)
at io.appium.java_client.DefaultGenericMobileDriver.(DefaultGenericMobileDriver.java:38)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:84)
at io.appium.java_client.android.AndroidDriver.(AndroidDriver.java:85)
at com.kms.katalon.core.appium.driver.SwipeableAndroidDriver.(SwipeableAndroidDriver.java:24)
at com.kms.katalon.core.appium.driver.AppiumDriverManager.createMobileDriver(AppiumDriverManager.java:498)
at com.kms.katalon.core.appium.driver.AppiumDriverManager.createMobileDriver(AppiumDriverManager.java:480)
at com.kms.katalon.core.mobile.keyword.internal.MobileDriverFactory.startMobileDriver(MobileDriverFactory.java:410)
at com.kms.katalon.composer.mobile.objectspy.dialog.MobileInspectorController.startExistingApp(MobileInspectorController.java:142)
at com.kms.katalon.composer.mobile.objectspy.components.MobileLocalAppComposite$12$1.call(MobileLocalAppComposite.java:482)
at com.kms.katalon.composer.components.impl.dialogs.ProgressMonitorDialogWithThread.startThreadAndWait(ProgressMonitorDialogWithThread.java:36)
at com.kms.katalon.composer.components.impl.dialogs.ProgressMonitorDialogWithThread.runAndWait(ProgressMonitorDialogWithThread.java:48)
… 2 more
Caused by: java.lang.reflect.InvocationTargetException
at io.appium.java_client.remote.AppiumCommandExecutor$1.createSession(AppiumCommandExecutor.java:186)
… 22 more
Caused by: org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Cannot start the ‘com.android.settings’ application. Visit appium/activity-startup.md at master · appium/appium · GitHub for troubleshooting. Original error: Error executing adbExec. Original error: ‘Command ‘C:\Users\tester\.katalon\tools\android_sdk\platform-tools\adb.exe -P 5037 -s K5J0220528005539 shell am start -W -n com.android.settings/.Settings -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000’ timed out after 30000ms’. Try to increase the 30000ms adb execution timeout represented by ‘adbExecTimeout’ capability
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:25:53’
System info: host: ‘LAPTOP-7932I49J’, ip: ‘192.168.48.1’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_181’
Driver info: driver.version: SwipeableAndroidDriver
remote stacktrace: UnknownError: An unknown server-side error occurred while processing the command. Original error: Cannot start the ‘com.android.settings’ application. Visit appium/activity-startup.md at master · appium/appium · GitHub for troubleshooting. Original error: Error executing adbExec. Original error: ‘Command ‘C:\Users\tester\.katalon\tools\android_sdk\platform-tools\adb.exe -P 5037 -s K5J0220528005539 shell am start -W -n com.android.settings/.Settings -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000’ timed out after 30000ms’. Try to increase the 30000ms adb execution timeout represented by ‘adbExecTimeout’ capability
at getResponseForW3CError (C:\Users\tester\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\errors.js:804:9)
at asyncHandler (C:\Users\tester\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\protocol.js:384:37)
at org.openqa.selenium.remote.W3CHandshakeResponse.lambda$errorHandler$0(W3CHandshakeResponse.java:62)
at org.openqa.selenium.remote.HandshakeResponse.lambda$getResponseFunction$0(HandshakeResponse.java:30)
at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$0(ProtocolHandshake.java:126)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:128)
… 23 more

anything i need to add to settings desire capabilities?
i tried
appWaitPackage
appWaitDuration

not working still

i tried another way, launch app in test case

Mobile.startExistingApplication(‘com.ninefolders.hd13’)

error like below.
i wondering what is the command purpose of this “com.android.settings/.Settings -S” ?

2020-12-11 17:46:03.493 ERROR c.k.k.core.keyword.internal.KeywordMain - :x: Unable to start app with application ID: ‘com.testapp.aa12’ (Root cause: org.openqa.selenium.SessionNotCreatedException: Unable to create a new remote session. Please check the server log for more details. Original error: An unknown server-side error occurred while processing the command. Original error: Cannot start the ‘com.android.settings’ application. Visit https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting. Original error: Error executing adbExec. Original error: ‘Command ‘C:\Users\tester\.katalon\tools\android_sdk\platform-tools\adb.exe -P 5037 -s K5J0220528005539 shell am start -W -n com.android.settings/.Settings -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000’ timed out after 20000ms’. Try to increase the 20000ms adb execution timeout represented by ‘adbExecTimeout’ capability
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:25:53’
System info: host: ‘LAPTOP-7932I49J’, ip: ‘192.168.48.1’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_181’
Driver info: driver.version: MobileDriverFactory$startMobileDriver
remote stacktrace: UnknownError: An unknown server-side error occurred while processing the command. Original error: Cannot start the ‘com.android.settings’ application. Visit https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting. Original error: Error executing adbExec. Original error: ‘Command ‘C:\Users\tester\.katalon\tools\android_sdk\platform-tools\adb.exe -P 5037 -s K5J0220528005539 shell am start -W -n com.android.settings/.Settings -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000’ timed out after 20000ms’. Try to increase the 20000ms adb execution timeout represented by ‘adbExecTimeout’ capability
at getResponseForW3CError (C:\Users\tester\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\errors.js:804:9)
at asyncHandler (C:\Users\tester\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\protocol.js:384:37)
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:25:53’
System info: host: ‘LAPTOP-7932I49J’, ip: ‘192.168.48.1’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_181’
Driver info: driver.version: MobileDriverFactory$startMobileDriver

i have tried this, not working too
Name Type Value
appWaitActivity String *
appWaitDuration Number 30000

Hi @Gan_Jyi_Yng
It’s because Katalon Studio cannot launch the Android Settings app on your device.
You can add these capabilities:

"appPackage" : "your app id"
"appActivity" : "your app main activity"

Tips for finding your appPackage and appActivity: http://www.automationtestinghub.com/apppackage-and-appactivity-name/

1 Like

ok i will try to add appActivity
but when i use apk info to find activity, total of 126 returned.
any idea which one should i use?

The appActivity that’s nearby your appPackage: com.nintest.hd13

ok i got it from
C:\Users\tester>adb shell dumpsys window | find “mCurrentFocus”
mCurrentFocus=Window{dd32436 u0 com.ninetest.hd3/com.ninetest.hd3.activity.MailActivityEmail}

then i add
“appPackage” : com.ninetest.hd3
“appActivity” : com.ninetest.hd3.activity.MailActivityEmail

still error

another question
i have android sdk installed earlier
then katalon also installed similiar one, does it matter? i need to set anything at environment variables?
C:\Users\tester.katalon\tools\android_sdk

any other adb command i can use to grab all app activity and try out
i suspect this one isn’t the first activity appear at app

com.ninetest.hd3.activity.MailActivityEmail

then i add
“appPackage” : com.ninetest.hd3
“appActivity” : com.ninetest.hd3.activity.MailActivityEmail
still error

Are you trying start app from apk or app ID?

app id
i dont have the apk

by the way my python script running good a pycharm
*** Settings ***
Library AppiumLibrary

*** Test Cases ***
Open Application
Open Application http://localhost:4723/wd/hub platformName=Android deviceName=K5J0220528005539 appPackage=com.ninetest.hd3 appActivity=com.ninetest.hd3.activity.MailActivityEmail automationName=Uiautomator2

Can you share the stack-trace of the last try here?

i restarted laptop and now working
but it is lading to add acoount screen.
how do i make it launch the same like when i launch it manually at phone?
at phone app, email account added already. so it will land at inbox screen.
katalon land it at add account setup screen

You should add this capability to prevent app reset before new Appium session:

"noReset" : true

References: http://appium.io/docs/en/writing-running-appium/caps/

1 Like

Thanks. Yup I just found this argument. I’ll try it. Many thanks!