Taking Android phones screenshots from Ubuntu

Note: this guide has been tested with Ubuntu 9.04 , 9.10 and 10.04. If you have information for other versions, please add it.

This guide explains how to install the required software and prepare Ubuntu to take screenshots of your phone. If your device is NOT running Android 4.0 (Ice Cream Sandwich), then there is no way to take screen captures from the device itself, and this is by design, unless you "root" your phone. The focus of this guide is on getting screenshots from non-rooted devices.

There are two ways to take screenshots on your Android phone:

Using a separate computer running the Davik Debug Monitor (DDMS), which is available in the Android SDK (for non-rooted devices, described below)

Rooting your device and using an application such as drocap2. For more details also see Drocap2, One Of the Best Screen Capture Apps for Android.

Installing the Android SDK

IMPORTANT: Other guides mention installing Eclipse and Android development plugins, however this is not necessary if you only want to get screenshots from your device (as opposed to actually develop an application for it).

If using Ubuntu 10.04LTS, install the openjdk-6-jdk package using the Ubuntu Software Center, Synaptic or command line. Download the Android SDK for Linux. The current version as of this writing is Android r06. You should have a file named android-sdk_r06-linux_86.tgz or similar Uncompress the file by right-clicking on the archive file and clicking Extract Here , or use tar -xzvf android-sdk_r06-linux_86.tgz from command line.

Setting up UDEV rules to grant access to your phone.

Ubuntu won't allow the DDMS access to the Android phone via USB unless the appropriate udev rule is set. This is Bug #316215. In order to provide such rule, you need to create a rule file as root. From Applications > Accessories > Terminal : gksudo gedit /etc/udev/rules.d/90-android.rules Once the text editor comes up, insert the following in that file: SUBSYSTEM=="usb", ATTRS{idVendor}=="0bb4", MODE="0666" on some recent UDEVs this has changed to BUS=="usb", SYSFS{idVendor}=="0bb4", OWNER="MACHINEUSERNAME", GROUP="USERGROUP"

where you replace the owner and group with your own. No idea how to set this up on multiple users, probably multiline

(Note: The vendor id will may be different, depending on specific vendor)

Save the file and run the following command: gksudo service udev restart

Exit the terminal.

If your phone is already connected, you will need to unplug it and plug it again for this to apply.

The above permission effectively grant access to your phone to any other users on the same system. This isn't a problem unless the system you connect your phone to has other users. See Bug #316215 for more details.

Enabling USB debugging mode on your phone

Go to the Settings application, then Applications > Development . Mark the USB Debugging checkbox:

Connecting the phone via USB

Connect your phone via USB, without mounting the SD card as mass storage. Only the original cable will work.

Your notification area should look like this:

Starting DDMS for the first time, taking screenshots

Navigate to the directory where you extracted the Android SDK, locate the tools directory Double-click on ddms . You'll be asked if you want to share usage information:

After answering to the data-gathering question, DDMS should start and show your device on the left pane:

