Android Screenshots on Command Line

Found this snippet of code last week and it works beautifully to create an Android screenshot at the command line without going through the hassle of using DDMS.

Pull the current frame buffer from the Android device (phone or tablet) to a local file.

adb pull /dev/graphics/fb0 fb0

Convert and copy the frame buffer output block size to 1920 bytes, copy only 800 bytes, read from local frame buffer and write to a new file.

dd bs=1920 count=800 if=fb0 of=fb0b

Use FFmpeg to record a single raw video frame, and convert it to RGB32 pixel format (480×800 resolution) outputted to a single PNG file.

ffmpeg -vframes 1 -vcodec rawvideo -f rawvideo -pix_fmt rgb32 -s 480x800 -i fb0b -f image2 -vcodec png fb0.png

Stick this all in a nice Bash script and you’re good to go.

Reminder of how to use ADB over WiFi

One can enable ADB over WiFi from any Android device with the commands:

setprop service.adb.tcp.port 5555
stop adbd
start adbd

And one can disable it and return ADB to listening on USB with

setprop service.adb.tcp.port -1
stop adbd
start adbd

If one has USB access already, switching to WiFi is a breeze. From a terminal on a computer that has the device connected via USB, issue the commands (replace the IP with the IP of the device on the network):

adb tcpip 5555
adb connect 192.168.x.x:5555

To tell the ADB daemon return to listening over USB:

adb usb

‘Native’ Firefox for Android Test Day – Friday, January 6th, 2012

This upcoming Friday, the first week of the new year we would love for you to solicit your support towards testing and contributing to the process of qualifying the new native version of Firefox for Android on the Aurora channel as part of our Rapid Release testing cycle.

This event is open to all: newcomers, experienced testers, experienced developers, and people interested in testing.

If you’re keen on testing, we would like for you to use the new version of Firefox either on your Android phone or tablet, and take a close look at the latest builds in order to assist us in identifying any noticeably major issues found, and ensure that all feature functionality that is included in this upcoming release is on its way to a feature and testing complete state. We will also be looking at website compatibility, and device compatibility. No testing experience is required.

To cover the work throughout the whole day we have created an EtherPad test-plan. Please feel free to read and use it as a companion during the testday event. There will be moderators at hand in the IRC channel: #testday, to answer any questions you have.

Together with your help we want to make this testday a success and ensure the high quality of Fennec for mobile devices for all of our users world-wide. If you have time on Friday, January 6th, 2012, please join us on IRC, we will have Mozilla community and testers on hand to help answer any of your questions.

Your testing and feedback is highly valuable, and we hope to see you attend our testday event.