Unable to run sample Android Mobile Test

Got all the prerequisites installed and attempted to run the sample Android mobile tests however getting the following errors: Any help is appreciated.

Unable to start app at: ‘C:\Users\shirazmuthalif\Katalon Studio\T1.prj\androidapp\APIDemos.apk’ (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: Error getting device API level. Original error: Error executing adbExec. Original error: ‘Command ‘C:\Users\shirazmuthalif\.katalon\tools\android_sdk\platform-tools\adb.exe -P 5037 -s 2ebeae2c shell getprop ro.build.version.sdk’ exited with code 3221226356’; Stderr: ‘’; Code: ‘3221226356’
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:25:53’
System info: host: ‘670JSN2’, ip: ‘10.27.6.129’, 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: Error getting device API level. Original error: Error executing adbExec. Original error: ‘Command ‘C:\Users\shirazmuthalif\.katalon\tools\android_sdk\platform-tools\adb.exe -P 5037 -s 2ebeae2c shell getprop ro.build.version.sdk’ exited with code 3221226356’; Stderr: ‘’; Code: ‘3221226356’
at getResponseForW3CError (C:\Users\shirazmuthalif\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\errors.js:826:9)
at asyncHandler (C:\Users\shirazmuthalif\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\protocol.js:447:37)
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:25:53’
System info: host: ‘670JSN2’, ip: ‘10.27.6.129’, 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:497)
at com.kms.katalon.core.appium.driver.AppiumDriverManager.createMobileDriver(AppiumDriverManager.java:479)
at com.kms.katalon.core.mobile.keyword.internal.MobileDriverFactory.startLocalMobileDriver(MobileDriverFactory.java:460)
at com.kms.katalon.core.mobile.keyword.internal.MobileDriverFactory.startMobileDriver(MobileDriverFactory.java:374)
at com.kms.katalon.core.mobile.keyword.builtin.StartApplicationKeyword$_startApplication_closure1.doCall(StartApplicationKeyword.groovy:49)
at com.kms.katalon.core.mobile.keyword.builtin.StartApplicationKeyword$_startApplication_closure1.call(StartApplicationKeyword.groovy)
at com.kms.katalon.core.mobile.keyword.internal.MobileKeywordMain.runKeyword(MobileKeywordMain.groovy:21)
at com.kms.katalon.core.mobile.keyword.builtin.StartApplicationKeyword.startApplication(StartApplicationKeyword.groovy:51)
at com.kms.katalon.core.mobile.keyword.builtin.StartApplicationKeyword.execute(StartApplicationKeyword.groovy:40)
at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:56)
at com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords.startApplication(MobileBuiltInKeywords.groovy:74)
at com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords$startApplication.call(Unknown Source)
at Verify Correct Alarm Message.run(Verify Correct Alarm Message:24)
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:337)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:328)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:307)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:299)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:233)
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 TempTestCase1566931155566.run(TempTestCase1566931155566.groovy:21)
Caused by: java.lang.reflect.InvocationTargetException
at io.appium.java_client.remote.AppiumCommandExecutor$1.createSession(AppiumCommandExecutor.java:186)
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:497)
at com.kms.katalon.core.appium.driver.AppiumDriverManager.createMobileDriver(AppiumDriverManager.java:479)
at com.kms.katalon.core.mobile.keyword.internal.MobileDriverFactory.startLocalMobileDriver(MobileDriverFactory.java:460)
at com.kms.katalon.core.mobile.keyword.internal.MobileDriverFactory.startMobileDriver(MobileDriverFactory.java:374)
at com.kms.katalon.core.mobile.keyword.builtin.StartApplicationKeyword$_startApplication_closure1.doCall(StartApplicationKeyword.groovy:49)
at com.kms.katalon.core.mobile.keyword.builtin.StartApplicationKeyword$_startApplication_closure1.call(StartApplicationKeyword.groovy)
at com.kms.katalon.core.mobile.keyword.internal.MobileKeywordMain.runKeyword(MobileKeywordMain.groovy:21)
at com.kms.katalon.core.mobile.keyword.builtin.StartApplicationKeyword.startApplication(StartApplicationKeyword.groovy:51)
at com.kms.katalon.core.mobile.keyword.builtin.StartApplicationKeyword.execute(StartApplicationKeyword.groovy:40)
at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:56)
at com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords.startApplication(MobileBuiltInKeywords.groovy:74)
at com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords$startApplication.call(Unknown Source)
at Script1529986178839.run(Script1529986178839.groovy:24)
… 11 more
Caused by: org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Error getting device API level. Original error: Error executing adbExec. Original error: ‘Command ‘C:\Users\shirazmuthalif\.katalon\tools\android_sdk\platform-tools\adb.exe -P 5037 -s 2ebeae2c shell getprop ro.build.version.sdk’ exited with code 3221226356’; Stderr: ‘’; Code: ‘3221226356’
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:25:53’
System info: host: ‘670JSN2’, ip: ‘10.27.6.129’, 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: Error getting device API level. Original error: Error executing adbExec. Original error: ‘Command ‘C:\Users\shirazmuthalif\.katalon\tools\android_sdk\platform-tools\adb.exe -P 5037 -s 2ebeae2c shell getprop ro.build.version.sdk’ exited with code 3221226356’; Stderr: ‘’; Code: ‘3221226356’
at getResponseForW3CError (C:\Users\shirazmuthalif\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\errors.js:826:9)
at asyncHandler (C:\Users\shirazmuthalif\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\protocol.js:447: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)
… 38 more
)

Hi @shirazmuthalif

Could you tell us please some more information:

1- What is the exact IP/Port you defined for the appium before starting it? something like 0.0.0.0:4723
2- Are you define the Desired Capabilities here: “Project” menu / “Settings” / “Desired Capabilities” / “Mobile” / “Android” ? If yes please leave here a screenshot of this section.
3- Did the Adb server running? It means does the CMD/Powershell return you device adb ID by typing this?
adb devices
4- What does the version of the Appium?
5- What does the version of the Katalon?
6- What is your os? (e.g. Windows 10)

Regards
Mohammad

Hi Mohammed,

  1. You are correct its the default - 0.0.0.0:4723
  2. Screen shot attached

  1. does not recognize adb however I have a samsung tablet and katalon does show the device when executing the test case

image

  1. Appium version - v1.14.2
  2. Katalon version - Version: 6.3.2 / Build: 4
  3. Windows 10 Enterprise

Thank you for taking a look to help resolve this.

Shiraz.

Any support on this is appreciated from the community of from Katalon.

1. Set your all android path properly:

Add a variable in system environment as mention below.

ANDROID_HOME : C:\Users[Your login name]\AppData\Local\Android\Sdk (Or any PATH that your android SDK located)

JAVA_HOME: C:\Program Files\Java\jdk1.8.0_172

ANDROID_SWT : C:\Users[Your login name]\AppData\Local\Android\Sdk\tools\lib\x86_64

ANDROID_PLATFORM_TOOLS : C:\Users[Your login name]\AppData\Local\Android\Sdk\platform-tools

Add below mention Path in Path Variable in the system environment. (If your SDK located in C:\Users[Your login name]\AppData\Local\Android\Sdk\ )

C:\Program Files\Java\jdk\bin;

C:\Users[Your login name]\AppData\Local\Android\Sdk\tools\bin;

C:\Users[Your login name]\AppData\Local\Android\Sdk\tools;

C:\Users[Your login name]\AppData\Local\Android\Sdk\platform-tools;

C:\Program Files\nodejs\node_modules\npm\bin;

C:\Users[Your login name]\AppData\Local\Android\Sdk;

C:\Users[Your login name]\AppData\Local\Android\Sdk\tools\lib\x86_64\swt.jar;

By completing these steps your “Adb devices” command should works.

2. Insert Desired Capabilities here: “Project” menu / “Settings” / “Desired Capabilities” / “Mobile” / “Android” like this

3.Downgrade the version of the appium to 1.12.x , because the Katalon isn’t working with version 1.13 and 1.14.

Regards

I am getting this error please help me

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: Error executing adbExec. Original error: ‘Command ‘C:\Users\yashk\.katalon\tools\android_sdk\platform-tools\adb.exe -P 5037 -s 523ae6b1 shell pm install -g /data/local/tmp/appium_cache/d9685eb331a81625742f66f9cf88cb6ab32937d0.apk’ exited with code 1’; Stderr: ‘’; Code: ‘1’
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:25:53’
System info: host: ‘DESKTOP-A0JOB4K’, ip: ‘192.168.1.11’, 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: Error executing adbExec. Original error: ‘Command ‘C:\Users\yashk\.katalon\tools\android_sdk\platform-tools\adb.exe -P 5037 -s 523ae6b1 shell pm install -g /data/local/tmp/appium_cache/d9685eb331a81625742f66f9cf88cb6ab32937d0.apk’ exited with code 1’; Stderr: ‘’; Code: ‘1’
at getResponseForW3CError (C:\Users\yashk\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\errors.js:826:9)
at asyncHandler (C:\Users\yashk\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\protocol.js:447:37)
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:25:53’
System info: host: ‘DESKTOP-A0JOB4K’, ip: ‘192.168.1.11’, 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: Error executing adbExec. Original error: ‘Command ‘C:\Users\yashk\.katalon\tools\android_sdk\platform-tools\adb.exe -P 5037 -s 523ae6b1 shell pm install -g /data/local/tmp/appium_cache/d9685eb331a81625742f66f9cf88cb6ab32937d0.apk’ exited with code 1’; Stderr: ‘’; Code: ‘1’
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:25:53’
System info: host: ‘DESKTOP-A0JOB4K’, ip: ‘192.168.1.11’, 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: Error executing adbExec. Original error: ‘Command ‘C:\Users\yashk\.katalon\tools\android_sdk\platform-tools\adb.exe -P 5037 -s 523ae6b1 shell pm install -g /data/local/tmp/appium_cache/d9685eb331a81625742f66f9cf88cb6ab32937d0.apk’ exited with code 1’; Stderr: ‘’; Code: ‘1’
at getResponseForW3CError (C:\Users\yashk\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\errors.js:826:9)
at asyncHandler (C:\Users\yashk\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\protocol.js:447:37)
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:25:53’
System info: host: ‘DESKTOP-A0JOB4K’, ip: ‘192.168.1.11’, 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:497)
at com.kms.katalon.core.appium.driver.AppiumDriverManager.createMobileDriver(AppiumDriverManager.java:479)
at com.kms.katalon.core.mobile.keyword.internal.MobileDriverFactory.startLocalMobileDriver(MobileDriverFactory.java:458)
at com.kms.katalon.composer.mobile.objectspy.dialog.MobileInspectorController.startMobileApp(MobileInspectorController.java:191)
at com.kms.katalon.composer.mobile.objectspy.components.MobileLocalAppComposite$12$1.call(MobileLocalAppComposite.java:479)
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: Error executing adbExec. Original error: ‘Command ‘C:\Users\yashk\.katalon\tools\android_sdk\platform-tools\adb.exe -P 5037 -s 523ae6b1 shell pm install -g /data/local/tmp/appium_cache/d9685eb331a81625742f66f9cf88cb6ab32937d0.apk’ exited with code 1’; Stderr: ‘’; Code: ‘1’
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:25:53’
System info: host: ‘DESKTOP-A0JOB4K’, ip: ‘192.168.1.11’, 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: Error executing adbExec. Original error: ‘Command ‘C:\Users\yashk\.katalon\tools\android_sdk\platform-tools\adb.exe -P 5037 -s 523ae6b1 shell pm install -g /data/local/tmp/appium_cache/d9685eb331a81625742f66f9cf88cb6ab32937d0.apk’ exited with code 1’; Stderr: ‘’; Code: ‘1’
at getResponseForW3CError (C:\Users\yashk\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\errors.js:826:9)
at asyncHandler (C:\Users\yashk\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\protocol.js:447: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

@yashkabra143,

Please run this command in terminal and share us the console output:

C:\Users\yashk\.katalon\tools\android_sdk\platform-tools\adb.exe -P 5037 -s 523ae6b1 shell pm install -g /data/local/tmp/appium_cache/d9685eb331a81625742f66f9cf88cb6ab32937d0.apk’

@duyluong I run this cmd in the terminal and I am getting this error


Currently I am using this npm and appium version

Please let me know asap
Thanks!!

@yashkabra143,

Please try this solution: Katalon - Cannot start Splash activities
or install your app on your device then use Start Existing Application keyword to start your app

I am getting this error please help me

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: Error executing adbExec. Original error: ‘Command ‘C:\Users\Admin\.katalon\tools\android_sdk\platform-tools\adb.exe -P 5037 -s 6b8539a2 shell ‘settings delete global hidden_api_policy_pre_p_apps;settings delete global hidden_api_policy_p_apps;settings delete global hidden_api_policy’’ exited with code 255’; Stderr: 'Security exception: Permission denial: writing to settings requires:android.permission.WRITE_SECURE_SETTINGS

java.lang.SecurityException: Permission denial: writing to settings requires:android.permission.WRITE_SECURE_SETTINGS
at com.android.providers.settings.SettingsProvider.enforceWritePermission(SettingsProvider.java:2340)
at com.android.providers.settings.SettingsProvider.mutateGlobalSetting(SettingsProvider.java:1405)
at com.android.providers.settings.SettingsProvider.deleteGlobalSetting(SettingsProvider.java:1388)
at com.android.providers.settings.SettingsProvider.call(SettingsProvider.java:603)
at android.content.ContentProvider.call(ContentProvider.java:2162)
at android.content.ContentProvider$Transport.call(ContentProvider.java:481)
at com.android.providers.settings.SettingsService$MyShellCommand.deleteForUser(SettingsService.java:399)
at com.android.providers.settings.SettingsService$MyShellCommand.onCommand(SettingsService.java:281)
at android.os.ShellCommand.exec(ShellCommand.java:104)
at com.android.providers.settings.SettingsService.onShellCommand(SettingsService.java:49)
at android.os.Binder.shellCommand(Binder.java:881)
at android.os.Binder.onTransact(Binder.java:765)
at android.os.Binder.execTransactInternal(Binder.java:1021)
at android.os.Binder.execTransact(Binder.java:994)
Security exception: Permission denial: writing to settings requires:android.permission.WRITE_SECURE_SETTINGS

java.lang.SecurityException: Permission denial: writing to settings requires:android.permission.WRITE_SECURE_SETTINGS
at com.android.providers.settings.SettingsProvider.enforceWritePermission(SettingsProvider.java:2340)
at com.android.providers.settings.SettingsProvider.mutateGlobalSetting(SettingsProvider.java:1405)
at com.android.providers.settings.SettingsProvider.deleteGlobalSetting(SettingsProvider.java:1388)
at com.android.providers.settings.SettingsProvider.call(SettingsProvider.java:603)
at android.content.ContentProvider.call(ContentProvider.java:2162)
at android.content.ContentProvider$Transport.call(ContentProvider.java:481)
at com.android.providers.settings.SettingsService$MyShellCommand.deleteForUser(SettingsService.java:399)
at com.android.providers.settings.SettingsService$MyShellCommand.onCommand(SettingsService.java:281)
at android.os.ShellCommand.exec(ShellCommand.java:104)
at com.android.providers.settings.SettingsService.onShellCommand(SettingsService.java:49)
at android.os.Binder.shellCommand(Binder.java:881)
at android.os.Binder.onTransact(Binder.java:765)
at android.os.Binder.execTransactInternal(Binder.java:1021)
at android.os.Binder.execTransact(Binder.java:994)
Security exception: Permission denial: writing to settings requires:android.permission.WRITE_SECURE_SETTINGS

java.lang.SecurityException: Permission denial: writing to settings requires:android.permission.WRITE_SECURE_SETTINGS
at com.android.providers.settings.SettingsProvider.enforceWritePermission(SettingsProvider.java:2340)
at com.android.providers.settings.SettingsProvider.mutateGlobalSetting(SettingsProvider.java:1405)
at com.android.providers.settings.SettingsProvider.deleteGlobalSetting(SettingsProvider.java:1388)
at com.android.providers.settings.SettingsProvider.call(SettingsProvider.java:603)
at android.content.ContentProvider.call(ContentProvider.java:2162)
at android.content.ContentProvider$Transport.call(ContentProvider.java:481)
at com.android.providers.settings.SettingsService$MyShellCommand.deleteForUser(SettingsService.java:399)
at com.android.providers.settings.SettingsService$MyShellCommand.onCommand(SettingsService.java:281)
at android.os.ShellCommand.exec(ShellCommand.java:104)
at com.android.providers.settings.SettingsService.onShellCommand(SettingsService.java:49)
at android.os.Binder.shellCommand(Binder.java:881)
at android.os.Binder.onTransact(Binder.java:765)
at android.os.Binder.execTransactInternal(Binder.java:1021)
at android.os.Binder.execTransact(Binder.java:994)’; Code: ‘255’
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:25:53’
System info: host: ‘ITAM-MFB-180044’, ip: ‘192.168.189.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: Error executing adbExec. Original error: ‘Command ‘C:\Users\Admin\.katalon\tools\android_sdk\platform-tools\adb.exe -P 5037 -s 6b8539a2 shell ‘settings delete global hidden_api_policy_pre_p_apps;settings delete global hidden_api_policy_p_apps;settings delete global hidden_api_policy’’ exited with code 255’; Stderr: 'Security exception: Permission denial: writing to settings requires:android.permission.WRITE_SECURE_SETTINGS

java.lang.SecurityException: Permission denial: writing to settings requires:android.permission.WRITE_SECURE_SETTINGS
at com.android.providers.settings.SettingsProvider.enforceWritePermission(SettingsProvider.java:2340)
at com.android.providers.settings.SettingsProvider.mutateGlobalSetting(SettingsProvider.java:1405)
at com.android.providers.settings.SettingsProvider.deleteGlobalSetting(SettingsProvider.java:1388)
at com.android.providers.settings.SettingsProvider.call(SettingsProvider.java:603)
at android.content.ContentProvider.call(ContentProvider.java:2162)
at android.content.ContentProvider$Transport.call(ContentProvider.java:481)
at com.android.providers.settings.SettingsService$MyShellCommand.deleteForUser(SettingsService.java:399)
at com.android.providers.settings.SettingsService$MyShellCommand.onCommand(SettingsService.java:281)
at android.os.ShellCommand.exec(ShellCommand.java:104)
at com.android.providers.settings.SettingsService.onShellCommand(SettingsService.java:49)
at android.os.Binder.shellCommand(Binder.java:881)
at android.os.Binder.onTransact(Binder.java:765)
at android.os.Binder.execTransactInternal(Binder.java:1021)
at android.os.Binder.execTransact(Binder.java:994)
Security exception: Permission denial: writing to settings requires:android.permission.WRITE_SECURE_SETTINGS

java.lang.SecurityException: Permission denial: writing to settings requires:android.permission.WRITE_SECURE_SETTINGS
at com.android.providers.settings.SettingsProvider.enforceWritePermission(SettingsProvider.java:2340)
at com.android.providers.settings.SettingsProvider.mutateGlobalSetting(SettingsProvider.java:1405)
at com.android.providers.settings.SettingsProvider.deleteGlobalSetting(SettingsProvider.java:1388)
at com.android.providers.settings.SettingsProvider.call(SettingsProvider.java:603)
at android.content.ContentProvider.call(ContentProvider.java:2162)
at android.content.ContentProvider$Transport.call(ContentProvider.java:481)
at com.android.providers.settings.SettingsService$MyShellCommand.deleteForUser(SettingsService.java:399)
at com.android.providers.settings.SettingsService$MyShellCommand.onCommand(SettingsService.java:281)
at android.os.ShellCommand.exec(ShellCommand.java:104)
at com.android.providers.settings.SettingsService.onShellCommand(SettingsService.java:49)
at android.os.Binder.shellCommand(Binder.java:881)
at android.os.Binder.onTransact(Binder.java:765)
at android.os.Binder.execTransactInternal(Binder.java:1021)
at android.os.Binder.execTransact(Binder.java:994)
Security exception: Permission denial: writing to settings requires:android.permission.WRITE_SECURE_SETTINGS

java.lang.SecurityException: Permission denial: writing to settings requires:android.permission.WRITE_SECURE_SETTINGS
at com.android.providers.settings.SettingsProvider.enforceWritePermission(SettingsProvider.java:2340)
at com.android.providers.settings.SettingsProvider.mutateGlobalSetting(SettingsProvider.java:1405)
at com.android.providers.settings.SettingsProvider.deleteGlobalSetting(SettingsProvider.java:1388)
at com.android.providers.settings.SettingsProvider.call(SettingsProvider.java:603)
at android.content.ContentProvider.call(ContentProvider.java:2162)
at android.content.ContentProvider$Transport.call(ContentProvider.java:481)
at com.android.providers.settings.SettingsService$MyShellCommand.deleteForUser(SettingsService.java:399)
at com.android.providers.settings.SettingsService$MyShellCommand.onCommand(SettingsService.java:281)
at android.os.ShellCommand.exec(ShellCommand.java:104)
at com.android.providers.settings.SettingsService.onShellCommand(SettingsService.java:49)
at android.os.Binder.shellCommand(Binder.java:881)
at android.os.Binder.onTransact(Binder.java:765)
at android.os.Binder.execTransactInternal(Binder.java:1021)
at android.os.Binder.execTransact(Binder.java:994)’; Code: ‘255’
at getResponseForW3CError (C:\Users\Admin\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\errors.js:804:9)
at asyncHandler (C:\Users\Admin\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\protocol.js:380:37)

@duyluong I am getting this error when I try to start spy on android devices, please help me

java.util.concurrent.ExecutionException: org.openqa.selenium.SessionNotCreatedException: Unable to create a new remote session. Original error: Connection reset
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:25:53’
System info: host: ‘DESKTOP-U3LMCNN’, ip: ‘10.8.0.26’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_282’
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:122)
Caused by: org.openqa.selenium.SessionNotCreatedException: Unable to create a new remote session. Original error: Connection reset
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:25:53’
System info: host: ‘DESKTOP-U3LMCNN’, ip: ‘10.8.0.26’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_282’
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.startLocalMobileDriver(MobileDriverFactory.java:539)
at com.kms.katalon.composer.mobile.objectspy.dialog.MobileInspectorController.startMobileApp(MobileInspectorController.java:196)
at com.kms.katalon.composer.mobile.objectspy.components.MobileLocalAppComposite$12$1.call(MobileLocalAppComposite.java:479)
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: java.net.SocketException: Connection reset
at okio.Okio$2.read(Okio.java:140)
at okio.AsyncTimeout$2.read(AsyncTimeout.java:237)
at okio.RealBufferedSource.indexOf(RealBufferedSource.java:355)
at okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:227)
at okhttp3.internal.http1.Http1Codec.readHeaderLine(Http1Codec.java:215)
at okhttp3.internal.http1.Http1Codec.readResponseHeaders(Http1Codec.java:189)
at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.java:88)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
at org.openqa.selenium.remote.internal.OkHttpClient$Factory$1.lambda$createClient$1(OkHttpClient.java:152)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:45)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:126)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:200)
at okhttp3.RealCall.execute(RealCall.java:77)
at org.openqa.selenium.remote.internal.OkHttpClient.execute(OkHttpClient.java:103)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:105)
… 23 more

@kristian021998

Which Appium version you are using?
Does this happen with other apps?
Do you configure proxy in Katalon Studio?