Turn on wifi from adb

Sunday, May 20, 2012

Today I found myself locked from my own phone: I accidentally tried the wrong pattern to many times and was asked to login to google - unfortunately for me, I had no internet connection, making it impossible to do so (not nice google).

I successfully got myself out of this situation by enabling wifi from adb and rebooting the system. It is actually quite simple, provided that your phone is rooted (I'm on ICS 4.0.4) :

adb shell
sqlite3 /data/data/com.android.providers.settings/databases/settings.db
update secure set value=1 where name='wifi_on';

I did found other useful settings for my own situation, but I wont publicize them here.


Har Pav September 9, 2012 at 8:39 AM


I'm using Lenovo Ideapad K1 and i had the same problem. My tablet was not rooted and was running on ICS. I tried your method and voila ....IT WORKED. THANKS A LOT .. U R A GENIOUS.

sujith November 23, 2012 at 3:49 AM

Thanxxx, i just unlocked my HTC Explorer using this, I forgot the pattern n MIUI try to access the internet to verify google account and it worked.

Shobith Narayanan August 5, 2013 at 9:07 AM

Sheer genius! It worked well on Gingerbread! Thanks!!

Jordan Enerez November 6, 2013 at 7:04 AM

how to use that command? thanks!

Anuj Pratap March 2, 2014 at 10:37 PM

Guys please suggest
I am using HTC One X. phone has locked.
How Can I turn on wifi?
I don't see any drive when connect it to my laptop. please suggest.

Ahmet Karavaş March 29, 2016 at 10:26 AM

wifi on