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.

Logcat empty on some devices since

See original GitHub issue

The problem

Briefly describe the issue you are experiencing (or the feature you want to see added to Appium). Tell us what you were trying to do and what happened instead. Remember, this is not a place to ask questions. For that, go to http://discuss.appium.io!

Since Android platform-tools 28.0.1, some devices (i.e. my LG G6), have problems with logcat output. i.e. “adb logcat” output is empty, while “adb shell logcat” does output the logcat contents.

Is there a way to switch Appium to use the “adb shell” command, or make the shell output default?

Environment

  • Appium version (or git revision) that exhibits the issue: 1.17.1
  • Last Appium version that did not exhibit the issue (if applicable):
  • Desktop OS/version used to run Appium: Windows 10/ OSX
  • Node.js version (unless using Appium.app|exe):
  • Npm or Yarn package manager:
  • Mobile platform/version under test: Android
  • Real device or emulator/simulator: Device LG G6
  • Appium CLI or Appium.app|exe: Appium CLI and/or Appium.app|exe

Details

If necessary, describe the problem you have been experiencing in more detail.

This thread pretty much describes the problem: https://superuser.com/a/1357929

The behavior is same if used via “driver.manage().logs().get(“logcat”)” or via WebSocketConnection as described here: https://appiumpro.com/editions/55-using-mobile-execution-commands-to-continuously-stream-device-logs-with-appium

Link to Appium logs

Create a GIST which is a paste of your full Appium logs, and link them here. Do NOT paste your full Appium logs here, as it will make this issue very long and hard to read! If you are reporting a bug, always include Appium logs!

Code To Reproduce Issue [ Good To Have ]

Please remember that with sample code it’s easier to reproduce the bug and it’s much faster to fix it.

Please git clone https://github.com/appium/appium and from the sample-code directory, use one of your favourite languages and sample apps to reproduce the issue.

In case a similar scenario is missing in sample-code, please submit a PR with one of the sample apps provided.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
mykola-mokhnachcommented, Dec 17, 2020

You could change the command locally by modifying server sources for https://github.com/appium/appium-adb/blob/482ca14b18274b3b862f66f605607dbf773d0501/lib/logcat.js#L89

0reactions
senchicommented, Dec 23, 2020

PS. The patch with adb shell -x logcat works, but use it with caution because it slowed test execution time by a factor of three. Therefore, in our particular case, we’re going to use the adb from 28.0.0 platform-tools which work with this LG model.

Thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

android - Logcat doesn't show anything - Stack Overflow
press the Ctrl+Shift and mouse right click at the empty place and select open command window here to open command window.
Read more >
How to Fix "Android studio logcat nothing to show" in Android ...
To open Logcat Click View > Tool Windows > Logcat (Alt + 6 or from the toolbar window). Sometimes logcat shows nothing and...
Read more >
Logcat command-line tool - Android Developers
Logcat is a command-line tool that dumps a log of system messages when the device throws an error and sends messages that you...
Read more >
Android Logcat is empty when debug with device in android ...
Logcat is empty when trying to debug either on an emulator or a real device. ... outside of Android Studio after starting it...
Read more >
Changelog | Android Logcat | 1.3.2
Remove automatic stacktrace resolving when receiving logcat messages, since in some cases it's impossible to automatically determine the correct ...
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