Take screenshots of your Android phone from Windows or Linux


Let’s say your client requires employees to have an Exchange account on their Android mobile devices. You decide to create user documentation with screenshots that help show how to add an Exchange account on Android. The bad news is taking screenshots of an Android mobile device is not a simple process. Instead of just loading an app on your phone and then taking the screenshots, you have to install the developer kit on your PC and snag the screenshots using that tool.

This tutorial shows how to take screenshots of an Android phone from the Windows and the Linux platform. I go into more detail on the Linux side because it’s more challenging.

Enable USB debugging


Before you can take screenshots from your Android phone, you have to enable USB debugging. To do this, tap your device’s Menu button and then tap Settings. From there, tap Applications | Development and make sure USB Debugging is checked.

Install the SDK


You need to install the Android SDK, which you can find on the Android Developer site. Choose the download for your platform and save it on your drive. After the SDK is downloaded, you need to extract the tool that will create a new directory ./android-sdk_XXX (XXX is the platform and/or the release number). Once the SDK is unpacked, you need to prepare your system for its use.

Install JDK


In order to use the Android SDK, you must install the Java Development Kit (JDK). If you’re using Ubuntu Linux, you open the Ubuntu Software Center, do a search for openjdk, and install the most recent version. If you’re using Windows, you download and install the JDK from the Oracle website.

Special instructions for Linux users


If you’re using Linux, the tool you must run to take screenshots is the ddms tool (Dalvik Debug Monitor). If you try to run the command ~/Downloads/android-sdk-XXX/tools/ddms (assuming you unpacked the SDK in ~/Downloads), you’ll notice three issues that need to be fixed.

1. You’re going to need sudo access, so the command must be run using sudo.

How to fix: use sudo when running the command.

2. The ddms tool doesn’t seem to be aware of everything it needs to run (especially adb).

How to fix: You have to instruct the SDK to run a full update. To do this, open a terminal window, change to the directory where the SDK was unpacked, change into the android-sdk-XXX/tools directory (where XXX is the platform and/or release number), and issue the command ./android update sdk. This will take some time because it has a lot of downloading to do.

3. Your phone cannot be recognized.

How to fix: The Linux system has no way of knowing how to recognize the make and model of the phone, so issue this command gksudo gedit /etc/udev/rules.d/90-android.rules, which will open up the Gedit text editor. You should add this line SUBSYSTEM==”usb”, ATTRS{idVendor}==”0bb4″, MODE=”0666″. Save that file and then restart your system. (Although someone might tell you that you can just restart the udev service with the command gksudo service udev restart, I have yet to see the command work with this particular process.)

Once the system has rebooted, log back in, open a terminal window, and issue the command to start the ddms. You should see your phone listed (Figure A). If you do, you’re ready to start snapping screenshots.

Figure A



Note: You can have more than one device here if you need. For that, you will have to create multiple udev rules if the devices are different.

Here is a list of popular vendor IDs. The vendor ID will differ for each model.

Acer
0502
Dell
413c
Foxconn
0489
Garmin-Asus
091E
HTC
0bb4
Huawei
12d1
Kyocera
0482
LG
1004
Motorola
22b8
Nvidia
0955
Pantech
10A9
Samsung
04e8
Sharp
04dd
Sony Ericsson
0fce
ZTE
19D2

 

Notes for Windows users


From the Windows side of things, you should only need to navigate to the directory you have unpacked the SDK into, change into the Tools directory, and then double click the ddms icon.

How to take the screenshots


Windows users and Linux users, follow these steps to take a screenshot:

1. Select the device from which you want to take a screenshot.
2. Click Device | Screen Capture.
3. When the new window opens (Figure B), click the Save button.
4. Navigate to where you want the image saved and give the image a name.

Figure B



If you change the screen on your Android device to save a new screenshot, click the Refresh button, and the new screen will appear.

Summary


Once you’re able to get screenshots of an Android phone, you’ll see that the ability to grab these images can go a long way to helping users learn how to use their tools.