How to Unlock Pattern Locked Android Smartphone with ADB Commands?
Most probably everyone might face the situation of getting Android device locked or it’s just freezing quite a lot. There are many easy solutions right from removing its battery, manual resetting (click here) and using backup options such as sky drive and much more.
But what if your device does not start itself? Or it is locked with multiple attempts? Or it may be for some other reason. Again if you have no Wi-Fi ON or your device is in airplane mode or not set to internet accessibility.
But what if your device does not start itself? Or it is locked with multiple attempts? Or it may be for some other reason. Again if you have no Wi-Fi ON or your device is in airplane mode or not set to internet accessibility.


The answer is using windows based commands to operate your Android device to resolve this issue.
Method: Using ADB (Android Debug Bridge) Commands
Requirements:
1. Windows PC
2. Device with USB cable
3. Android SDK developer toolkit (Click here to get from Android Developer Website)
4. Usb drivers for your device, or if your device is recognizing self then it’s not required
If this does not list your device then try to go on your device's company's website or Google your device with "device name android USB drivers for windows", (Click here to get from Developer Website)
5. Proper command follow-up
Unzip downloaded Android SDK files on your PC. Go to unzipped SDK folder and follow this path
"android-sdk_r07-windowsandroid-sdk-windowstools"
Just click an adb.exe file to install the program, it shows a small window and it disappears immediately. Don't worry, its done.
Click Start>Run>cmd. This will take you to dos-based windows command prompt window.
Type cd "android-sdk-windowstools"
You must be now in the ADB folder.
In the came command window type "adb devices"
If it shows the device then you are on a correct path. If not, you probably need your phone's driver set to install in the computer.
Now you must be ready to do work on your Android device, such as backup, flashing, resetting, hard resetting.
Above method is discussed considering your Android device is locked with multiple pattern password attempts. So we will move further to run few more commands to unlock it in easy ways.
In cmd type in following set of commands
adb devices (This will show your device)
adb shell
cd/data/data/com.android.providers.settings/databases
sqlite3 settings.db
update system set value=0 where name='lock_pattern_autolock';
update system set value=0 where name='lockscreen.lockedoutpermanently';
.quit
Now reboot your device. With this, your phone must be unlocked.
If above codes do not work then try below
adb shell rm/data/system/gesture.key
This will remove any pattern kept on your device and you will need to input new pattern.
Note: If you do not wish someone else to use ADB commands on your smartphone in any way then go to your smartphone's security options and select the option saying keep off USB debugging mode. But this is very risky as you do not need to worry so much about your smartphone as it is not a question of National Security.
If you like to add some more commands for easy navigation and recovery pl provide here for others help.
Subscribe to:
Post Comments (Atom)
Will this work for a pin password ?....i forgot my pin password not pattern
ReplyDeleteThanks For Your valuable posting, it was very informative. i am working in Erp In India
ReplyDeletealways welcome.... lot more to come... keep bookmarked or subscribe for sure. I gurantee you it will be worth in touch
ReplyDeleteNice
ReplyDeletewhat if usb debugging is off ?
Thanks For Your valuable posting, it was very informative. Am working in Erp Software Company In India
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThanks For Your valuable posting, it was very informative. Am working in Erp Software Company In India
ReplyDeleteI have successfully connected my android device with adb shell. But cannot
ReplyDelete$ rm /data/system/gesture.key
I am getting rm: /data/system/gesture.key: Permission denied. Error
My device is not rooted. Please help
same problem here....
DeleteYou'd definitely need root to do this. The explanation above, typos aside, is pretty lackluster. You can flash a custom recovery then flash SuperSU *IF* your screen is still working. If not it could be tricky. I didn't think there was a way to enable USB debugging with no screen but apparently there might be:
DeleteAdb shell
echo "persist.service.adb.enable=1" >>/system/build.prop
echo "persist.service.debuggable=1" >>/system/build.prop
echo "persist.sys.usb.config=mass_storage,adb" >>/system/build.prop"
reboot
Edit: Sorry I should have mentioned those commands would be done in a custom recovery like TWRP.
Apparently if you have a custom recovery and can get to a command prompt you can do the following to enable USB debugging:
DeleteAdb shell
echo "persist.service.adb.enable=1" >>/system/build.prop
echo "persist.service.debuggable=1" >>/system/build.prop
echo "persist.sys.usb.config=mass_storage,adb" >>/system/build.prop"
reboot
Smartphone Security Encrypted, secured communication solutions for smartphones and telephony systems, including complete anti-tapping & anti-hacking solutions and apps; advanced SCADA cyber defense solutions
ReplyDeleteWhen you purchase a phone from your carrier, it usually comes locked to their service. If you want to use the phone you purchased through your carrier on another service, chances are you'll need to unlock mobile phone. This will allow you to use SIM cards from other carriers.
ReplyDeletewat if usb debugging is disabled??
ReplyDeleteIf you have a custom recovery or can flash one (possible but tricky with no screen) the following commands supposedly enable it:
DeleteAdb shell
echo "persist.service.adb.enable=1" >>/system/build.prop
echo "persist.service.debuggable=1" >>/system/build.prop
echo "persist.sys.usb.config=mass_storage,adb" >>/system/build.prop"
reboot
Does it work with usb debugging disabled?? My phone is locked, and i can't change anything. Want to save my photos or unlock it some how.please help. Im desperate. Just want my phoyos as my family are on thrre. Some whcih are not around anymore :(
ReplyDeleteStep 1. After download Aroma File Manager place it in your memory card (SD card). Insert the memory card into your locked android device.
DeleteStep 2. Open Stock Recovery Mode with reboot your android device and pressing Power Key and Volume up key simultaneously. Different phones may be have different methods to open stock recovery mode so if you face any problem Google it.
Step 3. After entering into recovery mode use Volume+ and Volume- buttons to scroll up and down. For select use middle button.
Step 4. From there click on “Install Zip from SD Card” and give path to install “Aroma File Manager” from SD card.
Step 5. After installing, it will open in recovery mode.
Step 6. From the Aroma File Manager navigate to settings >> go to bottom and click on “Automount all devices on start” and then exit.
Step 7. Repeat Step 4 & 5 again.
Step 8. After this you will get “Aroma File Manager” opened again.
Step 9. Now navigate to Data Folder >> System Folder and find >> “gesture.key” or “password.key” for pattern lock or password lock respectively.
Step 10. Delete that any one file and then exit aroma file manager and reboot your android device. After rebooting you will notice that password or pattern lock not removed. But don’t worry draw any pattern and you will open your android device but remember or note that pattern.
Does it work with usb debugging disabled?? My phone is locked, and i can't change anything. Want to save my photos or unlock it some how.please help. Im desperate. Just want my phoyos as my family are on thrre. Some whcih are not around anymore :(
ReplyDeletehttp://android.stackexchange.com/questions/112040/how-to-enable-usb-debugging-in-android-if-forgotten-pattern-for-screen-unlock
Deletehttp://forum.xda-developers.com/showthread.php?t=2308130
Deletehttp://forum.xda-developers.com/showthread.php?t=2786395
DeleteDoes it work on unrooted phone
ReplyDeleteHere is another way to unlock pattern lock for Samsung Galaxy phones, and no data loss
ReplyDeletehttp://www.youtube.com/watch?v=lw4ueft-t_I
android is linux spawn
ReplyDeletea shitty os crafted by kids desperately fleeing off from windoze
those f**ing linux turds always amaze me on their incompetencies
Are you aware that both iOS and Android are Linux based?
ReplyDeleteOr that nearly every web server/data center runs on Linux? It's anything but a shitty OS, but you obviously have no real knowledge of OSs.
LMFAO! Justin, thank you my friend. You just took the words right from my mouth about this guy trying to say android is a crappy linux OS. HAHAHAHA He claims being amazed by their incompetence, LMAO who's the one with extreme incompetence now lol!!!!
ReplyDeletewell anyways quick question and shot in the dark and I do apologize for my question as it doesn't pertain to this posting but would you happen to know an ADB Method that would help me retrieve my sim/network unlock code for my android device? I currently have a Moto E 2nd Gen model XT1526 that id like to get to work on verizons network. This is a great informative post by the way to the providers of this site.
Setup.exe blunders might be created by malignant programming programs, on the grounds that these projects can roll out improvements to your framework. Your framework may run moderate, show incessant mistake messages, crash, or need rebooting every now and again when these product projects are available on your PC.ABD Setup
ReplyDeleteI tried rm/data/system/gesture.key it said no such file i donnot know the problem
ReplyDelete