Photo credit Blair Fraser.

Broken screen? How to backup your data from a broken Android device

Last week somehow I managed to break my smartphone screen. It’s a BQ Aquaris E5 and it felt screen faced on the ground, resulting in a broken screen and LCD!! :( 
 The touch functionality is gone, and only the side buttons are working now, so my first thought was, no problem I’ll connect it to the computer and navigate in the file tree to pull back all the files that I want… nope, not going to happen. I don’t have the USB mass storage mode enabled.

Now what?

Solution #1

I need a micro USB cable to connect a mouse, this way i can navigate in the OS and drop the files in Google Drive or Dropbox. But the screen is broken and mostly black, so I can’t really see what am I doing.

Solution #2

On my way to find a better solution, what I need is a micro USB to HDMI MHL Adapter, to connect the phone to a mouse and a TV, but I don’t have any and ordering one will take at least 4 to 10 days, so what other options do I have?

Android Debug Bridge

Android Debug Bridge (adb) is a versatile command line tool that lets you communicate with an emulator instance or connected Android-powered device. — Source

Yes, adb to the rescue! To install it the fastest way is by installing the Android SDK. After that connect the phone to the computer and create a folder to store the backup files. 
 Open up the terminal cd backup_folder_name and type:

adb devices

This command ensures that your device is properly recognized, if it returns a device ID, you’re connected and ready to send commands.

Nice, so let’s get all the stuff we want, in my case I just needed the photos in the DCIM folder and all PDFs and eBooks.

ADB Shell

This command is used to run a variety of other commands on a connected device. 
 Run adb shell

Navigate to the folder using cd folder_name and ls to show the folder content.

After locating the photos folder exit the shell and run:

adb pull mnt/sdcard/DCIM/Camera/

It will pull all the photos from the Camera folder to the folder in your desktop from where you’re running these commands.

The pull command in ADB allows you to copy files from your phone to your computer. When pulling files, you can choose to leave out the destination parameter. In that case, the file will be copied to the folder on your computer where ADB itself lives.

Breath out, everything went better than expected :)

Repeat this process to other folders in order to retrieve other content you might want and you’re all set for success!

Long live the terminal and the ease of use of an Android System.

Follow me on Medium.
Photo credit Blair Fraser.