Skip to content

Instantly share code, notes, and snippets.

@dotherightthing
Created August 15, 2019 05:48
Show Gist options
  • Save dotherightthing/e5647ac51b4218d71c445325a5a03518 to your computer and use it in GitHub Desktop.
Save dotherightthing/e5647ac51b4218d71c445325a5a03518 to your computer and use it in GitHub Desktop.
[Unlock Android phone via USB] #android

Unlock Android phone via USB

Created: 2017.05.14

Drenched during my latest cycle tour, my Samsung SM-A300F/DS no longer responded to touch. Repair shops have a nasty habit of wiping data - how could I unlock the phone and download my precious travel pics first?

Initial attempts

Dr Fone

This is the app that comes up most often in search results when searching via Google.

Against my better judgement (and the reviews on Amazon), I downloaded and installed WonderShare Dr Fone, then left it running when I went out for dinner. It didn't work, but thankfully it didn't hold my files to ransom either!

Samsung Kies aka SmartSwitch

Several blogs recommended using the Samsung Kies app to transfer the data off my phone. I couldn't install this app on my brother-in-law's Windows 7 machine due to a weird Side by Side error.

When I got home, I could install it on my MacBook Air running Mac OS Sierra. However launching the app just prompted me to unlock my phone, which I of course couldn't do.

The same blogs also mentioned logging into my Samsung account and using Find My Mobile to unlock my phone remotely. But I didn't have a Samsung account, so this was a non-starter.

Android Studio

Later I searched via DuckDuckGo and found How To Unlock Android Device With Cracked Or Broken Screen.

This recommended installing the Android SDK package, but the included SDK link resolved to a page to download Android Studio.

I installed Android Studio, but right clicking on the installed application didn't reveal the required platform-tools.

Had I scrolled to the bottom of the download page, I would have actually found the standalone SDK installer.

Android SDK

Following further searches, I found How To Install ADB on Mac OS X and Get Root Access To Android Device? and, in turn, the standalone SDK.

However the install process prompted me to install Java, which I did, but it still wasn't detected. More searching indicated a potential conflict with Mac OS Sierra.

I resorted to RTFM, linking to the docs from Android Studio.

This led me to the Android SDK Platform Tools, which was actually what I wanted.

And this led me to the SDK Platform Tools Release Notes - and the download for Mac.

What worked

Android SDK Platform Tools

Following the instructions at How To Unlock Android Device With Cracked Or Broken Screen:

  1. Download just the platform tools
  2. Unzip to Users/Username
  3. cd platform-tools
  4. Enter your four digit pin: ./adb shell input text **** (note the leading ./)
  5. Press OK: ./adb shell input keyevent 66

Now my device was unlocked!

Samsung SmartSwitch

However Android File Transfer still couldn't read the phone's contents.

Luckily Samsung's SmartSwitch could, so I used that to drag and drop my precious photos off the phone and on to my laptop. Like Android File Transfer this app also uses a drag and drop mechanism (I often wonder how keyboard users find a way to use this, without a mouse).

Anyway, my files copied successfully and disaster was successfully averted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment