Recorder fails to install apk on mobile devcie

I am trying to start the mobile recorder by clicking the mobile record button - everything loads until a point where it fails and gives some licencing error. I am unable to copy the error message. I am able to install the apk on the mobile device using adb - why can Katalon recorder not do the same?

If I install the apk manually I van then launch the recorder and record some step items. When I try to play back the steps, the app is uninstalled from the android phone but then it fails to install it again. I am able to run the very same install command successfully directly in adb:

Test Cases/RunShowmax FAILED because (of) Unable to start app at: ‘C:\Projects\Automation\apks\adb -P 5037 -s ce061606a2a3e51404 install -r -g “C:\\Projects\\Automation\\apks\\app-staging-release.apk”’ (Root cause: org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: The application at ‘C:\Projects\Automation\apks\adb -P 5037 -s ce061606a2a3e51404 install -r -g “C:\\Projects\\Automation\\apks\\app-staging-release.apk”’ does not exist or is not accessible

Build info: version: ‘3.7.1’, revision: ‘8a0099a’, time: ‘2017-11-06T21:07:36.161Z’

System info: host: ‘09CREL-B1KRNC2’, ip: ‘192.168.100.201’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_102’

Driver info: driver.version: SwipeableAndroidDriver

remote stacktrace: UnknownError: An unknown server-side error occurred while processing the command. Original error: The application at ‘C:\Projects\Automation\apks\adb -P 5037 -s ce061606a2a3e51404 install -r -g “C:\\Projects\\Automation\\apks\\app-staging-release.apk”’ does not exist or is not accessible

_ at getResponseForW3CError (C:\Users\jacob.jackson\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\errors.js:800:13)_

_ at asyncHandler$ (C:\Users\jacob.jackson\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\protocol.js:352:37)_

_ at tryCatch (C:\Users\jacob.jackson\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:67:40)_

_ at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Users\jacob.jackson\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:315:22)_

_ at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (C:\Users\jacob.jackson\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:100:21)_

_ at GeneratorFunctionPrototype.invoke (C:\Users\jacob.jackson\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:136:37)_

_ at )_

_Test Cases/RunShowmax.run:22

_

Hi Jacob, I’m the same problem. Can you resolved this issue?

Hi @marco.pastore,

If you have an application already installed on your device that you don’t want to remove before the test (or between tests) you can pass false as the second parameter to the startApplication() function. So it would look like this:

startApplication("path\to\my\application", false)

Hope this helps,

Chris

2 Likes

Hi @Chris,

the problem is different. I have some problem with Spy Mobile Function, then was specified in the thread Katalon. There are same Katalon library that generate an exception.

Do you have a solution for my problem?

Thank you for response.

Hi @marco.pastore,

Thanks for clarifying. Could you confirm the versions of Katalon Studio and Appium that you’re using? Could you also please share any log files of screenshots of the error you’re seeing? That will be helpful in troubleshooting.

Here are some general things to check when troubleshooting mobile errors with Katalon:

Hope this helps,

Chris

Hi @Chris_Trevarthen,

my machine work with appium version 1.8.1 and Katalon version 6.0.5 but this problem was reproduced also Katalon version 5.4.X . I have the same log of Jacob on the top of thread.
Thanks for all,

Marco.

Hi @Chris_Trevarthen,

do you have a solution or an idea for this issue. This problem is very important for me. Can you help me, please?

Best regards,
Marco.

Hi @marco.pastore,

Here are a couple things you can try:

  1. Update your appWaitActivity setting like this person who was having an issue starting:
  1. Make sure the directory where your .apk is located has full read and write permissions as well as the .apk file itself

  2. Move the .apk file to a different directory

  3. Run the .apk on an emulator if you’re using it on a real device

  4. Check to see if you can run the .apk that’s included in the Sample Android Mobile Tests Project. This could tell whether there is a problem with your Katalon setup or device, or if it’s a problem with the .apk you are originally trying to test.

Hope this helps,

Chris

Hi Chris,

there are to many observations to the step that you have suggested. The point 2-3-4-5 are impossible solutions to problem because I tried only solutions with different apk version and different path location.
First, is interesting point. I prefix that work for mac and windows together. Only solution will be to set appWaitActivity. For this reason, I ask you, how set appWaitActivity?

Regards,
Marco!

Hi @marco.pastore,

Please check out this post about setting appWaitActivity:

Hope this helps,

Chris

Many Thanks! Really helpful.

Dear Chris, i have big problem, when i use katalon for recording mobile app, appium alway call aptoide app for install apk file, while i copy apk file to project forlder already.
pls help me check
Thanks you
code:
import static com.kms.katalon.core.checkpoint.CheckpointFactory.findCheckpoint
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 com.kms.katalon.core.configuration.RunConfiguration as RunConfiguration
import static com.kms.katalon.core.testobject.ObjectRepository.findWindowsObject
import com.kms.katalon.core.checkpoint.Checkpoint as Checkpoint
import com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords as CucumberKW
import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile
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.testng.keyword.TestNGBuiltinKeywords as TestNGKW
import com.kms.katalon.core.testobject.TestObject as TestObject
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
import com.kms.katalon.core.windows.keyword.WindowsBuiltinKeywords as Windows
import internal.GlobalVariable as GlobalVariable
import org.openqa.selenium.Keys as Keys
import com.kms.katalon.core.util.internal.PathUtil as PathUtil

‘String appFile = GlobalVariable.G_AndroidApp’

‘def appPath = PathUtil.relativeToAbsolutePath(GlobalVariable.G_AndroidApp, RunConfiguration.getProjectDir())’

‘Mobile.startApplication(appPath, false)’
Mobile.startApplication(‘C:\Users\ADMIN\Katalon Studio\TestAppMobile\viettelpay.apk’, false)

Mobile.waitForElementPresent(findTestObject(‘android.widget.ImageView (2)’), 20)

‘Điền mật khẩu’
Mobile.setText(findTestObject(‘android.widget.EditText - Nhp mt khu’), ‘850424’)

‘Chuyển tiền’
Mobile.tap(findTestObject(‘Object Repository/android.widget.ImageView’), 0)

‘Chuyển đến TK cá nhân’
Mobile.tap(findTestObject(‘Object Repository/android.view.View’), 0)

‘Ngân hàng’
Mobile.tap(findTestObject(‘Object Repository/android.view.View (1)’), 0)

‘Chọn MBBbank’
Mobile.tap(findTestObject(‘Object Repository/android.widget.ImageView (1)’), 0)

‘Số Tài khoản’
Mobile.tap(findTestObject(‘Object Repository/android.widget.EditText - S ti khon’), 0)

‘Điền số tài khoản’
WebUI.sendKeys(findTestObject(’’), ‘0080104510004’)

‘Số tiền’
Mobile.tap(findTestObject(‘Object Repository/android.widget.EditText - S tin()’), 0)

‘Điền số tiền’
WebUI.sendKeys(findTestObject(’’), ‘10000’)

‘điền số tiền’
Mobile.tap(findTestObject(‘Object Repository/android.widget.EditText - Ni dung (khng du v khng bt buc)’), 0)

Mobile.closeApplication()

When run record
[debug] e[35m[ADB]e[39m Running ‘C:\Program Files\Android\Android Studio\platform-tools\adb.exe -P 5037 -s R5CR11Q9JVH shell ‘settings put global hidden_api_policy_pre_p_apps 1;settings put global hidden_api_policy_p_apps 1;settings put global hidden_api_policy 1’’
[debug] e[35m[AndroidDriver]e[39m Parsing package and activity from app manifest
[debug] e[35m[AndroidDriver]e[39m Parsing package and activity from app manifest
[debug] e[35m[ADB]e[39m Getting install status for io.appium.settings
[debug] e[35m[AndroidDriver]e[39m Parsing package and activity from app manifest
e[35m[ADB]e[39m Package name: ‘cm.aptoide.pt’
e[35m[ADB]e[39m Package name: ‘cm.aptoide.pt’
[debug] e[35m[ADB]e[39m Running ‘C:\Program Files\Android\Android Studio\platform-tools\adb.exe -P 5037 -s R5CR11Q9JVH shell dumpsys package io.appium.settings’
e[35m[ADB]e[39m Package name: ‘cm.aptoide.pt’
e[35m[ADB]e[39m Main activity name: ‘cm.aptoide.pt.view.MainActivity’
e[35m[ADB]e[39m Main activity name: ‘cm.aptoide.pt.view.MainActivity’
[debug] e[35m[ADB]e[39m ‘io.appium.settings’ is installed
e[35m[ADB]e[39m Main activity name: ‘cm.aptoide.pt.view.MainActivity’