捕捉与亚洲开发银行和放大器的Andr​​oid设备的屏幕截图; perl的 [英] capture android device screenshot with adb & perl

查看:272
本文介绍了捕捉与亚洲开发银行和放大器的Andr​​oid设备的屏幕截图; perl的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试过一个班轮解决方案通过ADB捕捉屏幕截图,并成功创建PC上的文件,但它是不可读的:

I tried the one liner solution to capture screenshot via adb and the file is created successfully on PC but it is unreadable:

 C:\Program Files\Android\android-sdk\platform-tools>adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > c:\users\utilisateur\desktop\android_screenshot1.png

该文件似乎是正确的,但我认为魔术是不正确的:

The file seem to be correct but I think the Magic is not correct:

编辑:同样的问题发生在Git的Bash为Windows

The same issue happened with Git Bash for Windows.

推荐答案

的工作对我来说有一点调整:

@Passella answer worked for me with a little tweaking:

adb shell screencap -p "/mnt/sdcard/output.png" && adb pull "/mnt/sdcard/output.png" "C:\output.png" && adb shell rm "/mnt/sdcard/output.png"

我不得不引用路径和替换 | &放大器;&安培;

此外,如果您使用的是 Genymotion 模拟器,它更好地使用自己的亚行

Also, if you are using a Genymotion simulator, it's better to use its own adb:

C:\"Program Files"\Genymobile\Genymotion\tools\adb shell screencap -p "/mnt/sdcard/output.png" && C:\"Program Files"\Genymobile\Genymotion\tools\adb pull "/mnt/sdcard/output.png" "C:\output.png" && C:\"Program Files"\Genymobile\Genymotion\tools\adb shell rm "/mnt/sdcard/output.png"

这篇关于捕捉与亚洲开发银行和放大器的Andr​​oid设备的屏幕截图; perl的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆