question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

timeout of adb command / wait parameter

See original GitHub issue

The problem

My goal is to run end-to-end tests with Appium on an App built with Expo (turtle-cli). When starting the session, the app launches on the smartphone, but appium throws a timeout error:

[MJSONWP] Encountered internal error running command: Error: Cannot start the 'com.example.testetoeapplauda' 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 'adb -P 5037 -s ENU7N15B03007818 shell am start -W -n com.example.testetoeapplauda/host.exp.exponent.MainActivity -S' timed out after 20000ms'. Try to increase the 20000ms adb execution timeout represented by 'adbExecTimeout' capability

The interesting part is the adb shell command. When I run this command manually, the app launches, but the command does not finish - it just hangs forever.

When I remove the parameter -W it is not blocking.

So, how can I change Appium to don’t use the -W flag on the adb command?

Environment

  • Real device or emulator/simulator: real device Android 8.1.0
  • Appium CLI or Appium.app|exe: Appium-Desktop 1.13.0

Code To Reproduce Issue [ Good To Have ]

Here is a link to the APK file to reproduce the problem: expo-app-test apk file

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
KazuCocoacommented, Jul 29, 2019

@jjoe64 From the next version, appWaitForLaunch: false will allow avoiding -W option

Thanks

1reaction
jjoe64commented, Aug 5, 2019

yeah that’s working, thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

adb wait-for-devices timeout/nonblocking? - Stack Overflow
In Bash, timeout <time_in_seconds> adb wait-for-any-device. Ex: Below command waits for 40 seconds to scan for adb devices, and will return the exit...
Read more >
AppiumLibrary - GitHub Pages
AppiumLibrary can be imported with optional arguments. timeout is the default timeout used to wait for all waiting actions. It can be later...
Read more >
Process - Robot Framework
Waiting started process to complete using Wait For Process or stopping them with Terminate Process or Terminate All Processes. Table of contents.
Read more >
adb_shell.adb_device module
adb_shell.adb_device module¶ · command (str) – The shell command that will be sent · transport_timeout_s (float, None) – Timeout in seconds for sending...
Read more >
Appium Tip #12: Useful Timeout Capabilities and Commands
Timeouts are also useful for handling test execution, set frequency to wait for certain events to happen, or scale the use of multiple...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found