java-client icon indicating copy to clipboard operation
java-client copied to clipboard

Android API 33 : Original error: 'de.rm.app.android.debug' is still running after 500ms timeout

Open RSM-SBA opened this issue 4 years ago • 8 comments

The problem

I have under Android API 33 sometimes the issue that on driver.terminateApp() throws an error. Original error: 'de.rm.app.android.debug' is still running after 500ms timeout

It does not occur everytime. is it possible to make the timeout configurable

Environment

  • Appium version (or git revision) that exhibits the issue: 2.0 beta43
  • Last Appium version that did not exhibit the issue (if applicable):
  • Desktop OS/version used to run Appium: Monterey
  • Node.js version (unless using Appium.app|exe): 16.16
  • Npm or Yarn package manager: 8.11
  • Mobile platform/version under test: Android
  • Real device or emulator/simulator: Emulator
  • Appium CLI or Appium.app|exe: CLI

Link to Appium logs

(https://gist.github.com/StephanB75/1dfbe28ada1c99f7f0dc4e5e1d5e7d5d)

RSM-SBA avatar Sep 02 '22 07:09 RSM-SBA

Yes, the server API does provide such possibility: https://github.com/appium/appium-android-driver/blob/d6b1b4c8cc30af66b3389dff0bf4b210b25561fd/lib/commands/app-management.js#L130

mykola-mokhnach avatar Sep 02 '22 07:09 mykola-mokhnach

@mykola-mokhnach can you give me a hint on the java syntax ?

RSM-SBA avatar Sep 02 '22 07:09 RSM-SBA

https://github.com/appium/java-client/blob/bd66144e8a15ec9bbe1af8a4c25087d527b79e90/src/main/java/io/appium/java_client/InteractsWithApps.java#L101-L116 ?

KazuCocoa avatar Sep 05 '22 05:09 KazuCocoa

@KazuCocoa Thx but i still don't get it how to define a BaseTerminateApplicationOptions to append it to the terminateApp command :(

like this ? BaseTerminateApplicationOptions options= new AndroidTerminateApplicationOptions().withTimeout(Duration.ofSeconds(5));

RSM-SBA avatar Sep 05 '22 06:09 RSM-SBA

I think so

KazuCocoa avatar Sep 08 '22 05:09 KazuCocoa

yes it works, but i still have sometimes the problem that the app seems not be killed after teminateApp with a timeout of 15 seks. But most probably thats not an issue from appium.

RSM-SBA avatar Sep 08 '22 06:09 RSM-SBA

yes it works, but i still have sometimes the problem that the app seems not be killed after teminateApp with a timeout of 15 seks. But most probably thats not an issue from appium.

I am facing the same issue intermittently, how is this resolved?

snehith07 avatar Oct 30 '23 06:10 snehith07

Facing the same issue where terminateApp throws a org.openqa.selenium.WebDriverException

tech stack:

  • java - zulu-17
  • selenium - 4.20.0
  • appium - 9.2.2
  • appium server - 2.5.4

Exception error:

org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: 'de.check24.check24.beta' is still running after 500ms timeout
Build info: version: '4.20.0', revision: '866c76ca80'
System info: os.name: 'Mac OS X', os.arch: 'aarch64', os.version: '14.4.1', java.version: '17.0.10'
Driver info: io.appium.java_client.android.AndroidDriver$ByteBuddy$F0RCcQei
Command: [78cd3e50-bb2e-414d-a9e6-34347de7e464, executeScript {script=mobile: terminateApp, args=[{appId=de.check24.check24.beta, bundleId=de.check24.check24.beta}]}]

Appium logs:

[AndroidUiautomator2Driver@220b (78cd3e50)] Calling AppiumDriver.execute() with args: ["mobile: terminateApp",[{"appId":"de.check24.check24.beta","bundleId":"de.check24.check24.beta"}],"78cd3e50-bb2e-414d-a9e6-34347de7e464"]
[AndroidUiautomator2Driver@220b (78cd3e50)] Executing method 'mobile: terminateApp'
[AndroidUiautomator2Driver@220b (78cd3e50)] Terminating 'de.check24.check24.beta'
[ADB] Getting IDs of all 'de.check24.check24.beta' processes
[ADB] Running '/Users/xxx/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell 'pgrep --help; echo $?''
[ADB] Running '/Users/xxx/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell pgrep -f \(\[\[:blank:\]\]\|\^\)de\.check24\.check24\.beta\(\[\[:blank:\]\]\|\$\)'
[ADB] Running '/Users/xxx/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell am force-stop de.check24.check24.beta'
[AndroidUiautomator2Driver@220b (78cd3e50)] Querying the state of 'de.check24.check24.beta'
[ADB] Getting install status for de.check24.check24.beta
[ADB] Running '/Users/xxx/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell cmd package list packages'
[ADB] 'de.check24.check24.beta' is installed
[ADB] Getting IDs of all 'de.check24.check24.beta' processes
[ADB] Running '/Users/xxx/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell pgrep -f \(\[\[:blank:\]\]\|\^\)de\.check24\.check24\.beta\(\[\[:blank:\]\]\|\$\)'
[ADB] Running '/Users/xxx/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell dumpsys window displays'
[AndroidUiautomator2Driver@220b (78cd3e50)] Querying the state of 'de.check24.check24.beta'
[ADB] Getting install status for de.check24.check24.beta
[ADB] Running '/Users/xxx/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell cmd package list packages'
[ADB] 'de.check24.check24.beta' is installed
[ADB] Getting IDs of all 'de.check24.check24.beta' processes
[ADB] Running '/Users/xxx/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell pgrep -f \(\[\[:blank:\]\]\|\^\)de\.check24\.check24\.beta\(\[\[:blank:\]\]\|\$\)'
[ADB] Running '/Users/xxx/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell dumpsys window displays'
[AndroidUiautomator2Driver@220b (78cd3e50)] Querying the state of 'de.check24.check24.beta'
[ADB] Getting install status for de.check24.check24.beta
[ADB] Running '/Users/xxx/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell cmd package list packages'
[ADB] 'de.check24.check24.beta' is installed
[ADB] Getting IDs of all 'de.check24.check24.beta' processes
[ADB] Running '/Users/xxx/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell pgrep -f \(\[\[:blank:\]\]\|\^\)de\.check24\.check24\.beta\(\[\[:blank:\]\]\|\$\)'
[ADB] Running '/Users/xxx/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell dumpsys window displays'
[AndroidUiautomator2Driver@220b (78cd3e50)] 'de.check24.check24.beta' is still running after 500ms timeout
[AndroidUiautomator2Driver@220b (78cd3e50)] Encountered internal error running command: Error: 'de.check24.check24.beta' is still running after 500ms timeout
[AndroidUiautomator2Driver@220b (78cd3e50)]     at Object.wrappedLogger.errorWithException (/Users/xxxx/node_modules/@appium/support/lib/logging.js:114:43)
[AndroidUiautomator2Driver@220b (78cd3e50)]     at Object.wrappedLogger.errorAndThrow (/Users/xxx/node_modules/@appium/support/lib/logging.js:120:16)
[AndroidUiautomator2Driver@220b (78cd3e50)]     at AndroidUiautomator2Driver.terminateApp (/Users/xxx/.appium/node_modules/appium-uiautomator2-driver/node_modules/appium-android-driver/lib/commands/app-management.js:192:14)
[AndroidUiautomator2Driver@220b (78cd3e50)]     at AndroidUiautomator2Driver.mobileTerminateApp (/Users/xxx/.appium/node_modules/appium-uiautomator2-driver/node_modules/appium-android-driver/lib/commands/app-management.js:205:10)
[AndroidUiautomator2Driver@220b (78cd3e50)]     at AndroidUiautomator2Driver.executeMobile (/Users/xxx/.appium/node_modules/appium-uiautomator2-driver/lib/commands/execute.js:66:10)
[AndroidUiautomator2Driver@220b (78cd3e50)]     at AndroidUiautomator2Driver.execute (/Users/xxx/.appium/node_modules/appium-uiautomator2-driver/lib/commands/execute.js:24:14)
[HTTP] <-- POST /session/78cd3e50-bb2e-414d-a9e6-34347de7e464/execute/sync 500 897 ms - 694

sudo-naim avatar May 07 '24 14:05 sudo-naim