Record Video of Your Android Screen on a Mac with ADB
BackgroundI've been working a lot lately on writing mobile apps using the Ionic Framework. My goal is to be able to release apps for both iPhone and Android at roughly the same time. So far, I've only released apps for Android, simply because I'm too cheap to pay Apple $99/year. But that's neither here nor there.
The ProblemToday I wanted to record a demo video for one of my apps running on my Android test device, an older Samsung Galaxy S4. I had no idea how to do that. Camtasia 2 for the Mac supports iOS devices out of the box, but not Android. What to do?
After a bit of searching, I found instructions on a few different sites. None of them had all of the steps I needed. So rather than trying to remember where I found everything, I figured I'd put all of the instructions in one place on my own blog so I could find it again easily.
- Android Debugging Bridge or Android SDK
- USB to Micro USB cable (preferably the one that came with the device).
Record the Screen
- Connect the device to the Mac via USB.
- Open a terminal to the folder where you want the video to be saved.
- Run the command:
adb shell screenrecord /mnt/sdcard/Movies/test.mp4
- You may see some warnings, but no errors. I put the video in the standard Movies folder to make it easy to find on the device, in case I want to preview it before copying to the Mac.
- Press Ctrl+C to stop recording.
Copy the Video to the Mac
- Enter the following command at the terminal:
adb pull /mnt/sdcard/Movies/test.mp4 .
- Make sure you include the trailing dot at the end of that command.
- Use the video any way you wish.