Android and Me

How to take screenshots of Google TV over WiFi with ADB

3 years ago 43

A few days ago, my Logitech Revue received its long-awaited update to Android 3.1 and with it came glorious, glorious access to the Android Market. The main category I’d been longing to fill was a solid media player with decent codec support. I finally found that in Plex┬áso I wanted to review the app, which meant I needed a way to capture screenshots. Which, of course, I had no idea how to do.

Turns out it’s not a terribly complex process, but there are definitely a few gotchas that you should watch out for. You don’t even need to physically connect to the device, since the entire process is completed over WiFi via the Android Device Bridge (or ADB).

It’s called remote debugging and it’s something I’m sure the seasoned hackers out there are familiar with it but it’s not something I spent much time on myself. Also, after I got it working, I tweeted about my success, where @trsohmers chimed in and mentioned that remote debugging isn’t allowed on the Sony Google TV products, so this guide is exclusive to the Logitech Revue for the time being.

Update: As Cole points out in the comments, this method DOES work for the Sony Blu-ray player, so at least there’s that. It seems like only the Sony TV users are left in the cold here.

Prerequisite: Install the Android SDK

To complete the steps I’m about to lay out, you’ll need the Android SDK installed on your computer, the explanation of which is outside the scope of this tutorial- but fear not! There is ample explanation in other areas of the web, including a fairly old version right here on our site. If someone has a better basic SDK guide, please post it in the comments.

Another extremely important step is to set your Revue to display in 720p. The first few times I attempted this I was met with errors and it took finding an obscure post in a GTV Google Group to learn that 1080p is too large and will overrun the buffer. So for now, 720p is the way to go!

Once you’ve got the Android SDK installed on your workstation and a Logitech Revue powered up and on the network, you’re ready to connect and start debugging. If you’re Revue is in another room, you might want to make note of your workstation IP before we begin (example: 192.168.1.106).

Step 1: Enable Remote Debugging on the Revue

Before you can do anything, you’ll need to enable Remote Debugging on your Logitech Revue. You’ll find the option in Settings > Applications > Development and all you need to do is check a box:

While you’re here, you’ll also need to enter the IP address of your workstation computer. It’s basically a whitelist which allows your computer to connect- if you don’t enter the correct IP address here, you’re ADB command in the next step won’t work. I’d imagine this is for security, and I guess I appreciate it because I especially don’t want some goober peeping on what I’m watching.

Step 2: Retrieve IP address of GTV device

To connect to the device over WiFi, you’ll need the IP address of the Logitech Revue, which you can find in Settings > Network > Status:

Step 3: Connect to the GTV device via ADB

Once the Revue knows your workstation IP and you know the IP of the Revue, you’re ready to connect with a simple ADB command. Open up the command promt, and type:

adb connect <ip address>

replacing <ip address> with the actual IP we retrieved in the last step. If the command works, the prompt will return connected to <ip address> and you’ll be able to proceed as if you’d physically connected the device like you’ve done with a phone hundreds of times in the past.

Step 4: Capture screens using DDMS

Once you’ve got you’re GTV device connected (which you can verify by typing adb devices into the command prompt), you’ll be ready to capture screens using DDMS (the Dalvik Debug Monitor Server). Simply type ddms into the prompt and you’ll be on your way:

You’ll notice in the bottom of the DDMS window that you’ve got a ‘Log’ pane, which should be flashing all sorts of activity from your connected GTV device (this should let you know you’re on the right path). From there, just select Device > Screen Capture and you’ll get a nice capture of what’s going on on your Logitech Revue:

I should point out that the screen capture won’t work correctly if you’v got live TV currently displayed. Apparently they’ve used some sort of black magic to scrub the picture out, but almost every other app captures just fine.

In conclusion…

Now that I’ve got this new-found, TV-app-capturing capability, I plan on trying to do some more Google TV app reviews. Since I got the upgrade I’ve really been using the hell out of my Logitech Revue. My wife even just bought me a second one for Christmas (she even let me open it early because I guessed what it was). I opened it tonite and the upgrade came as part of the initial setup, so I see the Revue being at the center of my entertainment world for the foreseeable future.

I’d say my current favorite app is easily Plex for Google TV, which is a full-feature media player that feels close to what I thought I’d be getting with GTV the first time around. I can play all of my network media with ease, along with custom channels from around the internet. I’ll be working on a full review of Plex, but I was curious what other apps you GTV users have taken to. Is there anything else out there I totally need to check out?

And just for good measure, here is one more captured screenshot: