Mirroring Android UI for screencasts and demos
Here you can see me mirroring an Android device screen on a laptop:
From time to time, I need to demonstrate an Android application or concept and it’s much better to show it on a laptop or projector screen as opposed to just holding my small (well, not *that* small, it’s tablet-like) phone. There is an open source project that was created a while ago that makes this much easier, Android Screenshots and Screen Capture. Although the project doesn’t seem to have been updated for a while, it still works but requires a few tweaks to get running.
Basic Installation
The basic installation process is:
- Install the Android Developer Tools (the ADT bundle is the way to go)
- Download the JAR version of the project
- Extract the project somewhere
- Open the JAR
At this point, the project will prompt you for the path to the SDK folder for Android. Use the file picker to select your SDK path. In theory, if your phone is in developer mode, it will mirror on the app. However, in my experience, it wasn’t quite that easy… The following debugging steps should help though.
Step 1: Is the ADB daemon running?
ADB, the Android Debug Bridge, is what lets you do all sorts of wonderful things with your Android device when it is connected to your computer (or to do this with Virtual Android Devices). There are a few things with ADB that pretty much any Android developer should know how to do, most importantly connecting, running / deploying apps on, and checking the status for connected devices. To turn on the ADB daemon and run it in the mode where it is listening to USB, run ADB with the usb command:
adb usb
Note If the adb command is not in your PATH, it’s in your Android SDK folder under platform-tools.
When you run the adb usb command, you will get a response indicating that ADB is restarting and running in USB mode. Next, list your devices by running the list command through ADB:
adb devices
Now, you should see your device listed and connected from ADB:
So, the problem isn’t the device…. what could it be?
Step 2: Fix ADB paths for ASHOTS
The Android Screenshots and Screen Capture app hasn’t been updated in a while as far as I can tell. The relevant change since its last release is that the Android tools have moved the path for the adb tool from the tools folder to the platform-tools folder. So, we’ll create a symbolic link from the old folder to the new folder to fix the path issue:
cd tools ln -s ../platform-tools/adb
Now when you run the JAR for the app, everything will work and for the next (n) hours you will be playing with Android apps projected on your laptop screen… and will be ready to demo mobile apps with ease.
For me `java -jar AShot-1.1.jar` worked while doubleclicking the jar failed.
Thanks mucho for these
No problem, glad it was helpful!
I am unable to see my device on laptop scree.
First i download jar.. open it… set sdk path…
then i check whether my device is located or not using adb devices
After playing half hour still i can’t see my devices…
If you are on Windows you also need to symlink the 2 dll files.
ln -s ../platform-tools/AdbWinApi.dll
ln -s ../platform-tools/AdbWinUsbApi.dll
I opened JAR, set SDK directory but it says my device is disconnected. When I run adb devices though it shows my device.
Try as stated above: symlink the 2 dll files.