Returning empty screenshot on Android 4.4.2
See original GitHub issueI am taking screenshot by well known way:
File screenshot = device.getScreenshotAs(OutputType.FILE);
String deviceName = device.getCapabilities().getCapability("deviceName").toString();
File destFile = new File(BUILD_DIR + File.separator
+ deviceName + "-" + screenshotName + ".png");
try {
FileUtils.copyFile(screenshot, destFile);
} catch (IOException ex) {
throw new RuntimeException(ex);
}
It works just fine on my devices, expect Samsung Galaxy S4, which is running Android 4.4.2.
In Appium server log I can find these lines:
/wd/hub/session/5a1b71ee-5b92-468d-8c54-eb1356f837dc/screenshot
[debug] executing cmd: path/to/sdk/platform-tools/adb -s [particularSerialNumber] shell "/system/bin/rm /data/local/tmp/screenshot.png; /system/bin/screencap -p /data/local/tmp/screenshot.png "
[debug] executing cmd: path/to/sdk/platform-tools/adb -s [particularSerialNumber] pull /data/local/tmp/screenshot.png "/tmp/appium11553-11542-1iswk7x.png"
[debug] Responding to client with success: {"status":0,"value":"","sessionId":"5a1b71ee-5b92-468d-8c54-eb1356f837dc"}
<-- GET /wd/hub/session/5a1b71ee-5b92-468d-8c54-eb1356f837dc/screenshot {"status":0,"value":"","sessionId":"5a1b71ee-5b92-468d-8c54-eb1356f837dc"}
Please see that value
is empty. In result it creates an empty file.
When executing those adb
commands manually, it works. I am running Appium from source, with pretty much fresh master (May 4) - all found issues related to screenshots were resolved sooner.
Issue Analytics
- State:
- Created 8 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
How do I screenshot on my RCA Andriod 4.4.2 10" tablet?
You can make a screenshot by pressing the Volume down and Power buttons at the same time. This is a default feature since...
Read more >How do I prevent Android taking a screenshot when my app ...
Try FLAG_SECURE : public class FlagSecureTestActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.
Read more >Take a screenshot or record your screen on your Android device
Press the Power and Volume down buttons at the same time. At the bottom, tap Capture more. To select the content you want...
Read more >Private Screenshots - Apps on Google Play
Intro Some of the messaging apps detect screenshots you made from conversations. They notify person, you're chatting with, about the fact ...
Read more >How To Take Samsung Galaxy S4 Android 4.4 KitKat Screen ...
How To Take Samsung Galaxy S4 Android 4.4 KitKat Screen Shot / Capture / Print Screen. 22K views 9 years ago.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This has all been changes. Closing.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.