Skip to main content

Android Live Screen Mirroring on Ubuntu Using ADB Connection

live-screen Stream to Ubuntu PCIn this article I will show you how to mirror your android device screen on your Ubuntu PC with a Working adb Connection.

Screenshot from 2016-09-02 00-08-05

If you are already completed the setup procedure of android studio or eclipse with android sdk then you can proceed to the Following steps

 

Prerequisites

  • A physical android device
  • A Ubuntu PC Connected to Internet (Internet is for downloading the ffmpeg player)

 

How It Works

Android Debug Bridge (adb) is a versatile command line tool that lets you communicate with an emulator instance or connected Android-powered device. It is a client-server program that includes three components:

 

Using ADB Connection i am creating playing the Real-Time video Stream than streams the physical device screen on to the desktop player.

 

Step 1: Installing ADB Command Line tool

Installing ADB Command with Ubuntu Terminal. To launch Ubuntu Terminal

Ctrl+Alt+T

then type the following command

sudo add-apt-repository universe && sudo apt-get update

sudo apt-get install android-tools-adb

 

This will install adb command line tool and it will ask you to download the installation files. Press  Enter when it is asked to do

Check the installation status by using

adb devices

Screenshot from 2016-09-02 00-28-01

Step 2: Installing FFMPEG Player

To play the stream from your android device it is necessary to have ffmpeg player you can install it by using the following command

sudo add-apt-repository ppa:kirillshkrogalev/ffmpeg-next
sudo apt-get update
sudo apt-get install ffmpeg

 

Step 3: Connecting and Mirroring through ADB Connection

Run the following command to mirror the device screen to your desktop

adb shell screenrecord --output-format=h264 - | ffplay -

wait for a few minutes to start streaming it will automatically launch the player and start streaming Screenshot from 2016-09-02 00-08-05