This question already has an answer here:
- How to turn off Wifi via ADB? 8 answers
My phone has been locked (too many pattern attempts). To unlock I need to enter username and password on my gmail account. This is the only way I can unlock it. I cant launch any activities, even to turn on wifi connection. Without internet connection I can't sign in to restore my phone.
Maybe there is any command in adb to turn on my wifi connection, so I can use my phone?
You can turn on wifi : - connect usb on pc; - will show alert dialog "connect UMS mode or KIES" - do not click, do not cancel - pull notification bar and turn on wifi.
See these answers:
How to turn off Wifi via ADB?
Connecting to wi-fi using adb shell
However, I'm pretty sure that Google actually stores your email and password (at the time of saving to the device) for times like these. So when it needs to be unlocked, it won't require an internet connection.
I could be wrong. Either way, when I had this issue, I had internet connectivity, and I knew my username and password and it didn't care, kept saying they were wrong (even though I was logging into my email). Had to format the phone at the time!
Good luck.