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.

Improve Android Screen Record

See original GitHub issue

The problem

As an Automation Engineer using Appium, one issue that I have faced in the past is that screenrecord API does not work on devices where the manufacturer has chosen to remove such functionality out of its device shell. This is a problem that affects mostly Huawei devices as I’ve seen in a number of projects I’ve worked before. As a workaround I first would have to disable screen recording for such devices at my framework level, later I found a way to support such devices by using Scrcpy (a solution provided by the Genymobile guys). But still, this was a very cumbersome way to handle the issue and I wish Appium could handle it in a graceful way. One first step I took was to write a POC Node wrapper around Scrcpy binaries. After that I successfully managed to create methods at appium-adb that can query the device shell and determine if the target device has screenrecord binary or not, and my next step would be integrate it at the appium-android-driver level. However, that’s where things start to get a bit more complicated, and I thought it could be implemented the following way: before starting screen recording query adb and check whether device has screenrecord binary available, and then decide which library will use to start a screenrecord process (mostly fail proof and backwards compatible). I’d kindly ask for the Appium team’s feedback on this whole idea. Do you think it’s a viable/desirable solution for this problem? And how could I proceed with the best implementation?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
gfioretticommented, Jul 21, 2020

@mykola-mokhnach thanks for your feedback, there are valid concerns in there. I don’t see this proposal as adding a fourth screenrecording method, rather as an improvement on the “classic” endpoint as adding a fallback solution for a specific case (Android devices with custom firmware).

When it comes to the scrcpy, I totally agree that there is some sort of sorcery going on there. But the codebase is actively maintained by the Genymobile team - that also uses it for its own commercial solution - so I wouldn’t be concerned about long term support of this tool.

And yes, I share the same feeling that Chinese devices are kinda of a pain to work with, but from my experience they can’t be ignored as Huawei (and Xiaomi too for that matter) have already captured a fair piece of the device market share. I can only assume there are more automation engineers out there that are dealing with the same requirement of running tests against such devices and we could try to support them too.

With all that being said, I’m willing to take over the tasks of integrating and supporting the scrcpy solution myself.

1reaction
mykola-mokhnachcommented, Jun 17, 2022

I believe we could now implement an “ultimate” screen recording API by having https://github.com/appium/io.appium.settings/pull/88 in place. The original PR uses MediaProjection SDK and could record both audio and video in HD quality starting with Android 10.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Record the Screen on Your Android Phone | PCMag
Tap the Screen Recorder icon and give permission to the device to record the screen (you might have to edit the default icons...
Read more >
5 best Android apps for screen recording and other ways too
The best Android apps for screen recording · AZ Screen Recorder · InShot Screen Recorder · Link to Windows · Twitch · Vysor...
Read more >
Best Ways to Screen Record on Android - Wondershare Filmora
Find out all the different methods and tools to screen record on Android. ... Enhance videos with 300+ stunning effects; Personalize the crop...
Read more >
5 Great Screen Recording Apps for Android
Alternatively, if you have an Android 11 or up you can opt to use the built-in screen recording feature without having to install...
Read more >
How to Screen Record on Android | Screencast-O-Matic
With the built-in Android screen recorder, you can record your screen in high definition, with optional audio from your microphone. You can also...
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