#connect adb over wi-fi
adb shell setprop service.adb.tcp.port 5555 && stop adbd && start adbd
adb connect
#Unlock your Android screen
adb shell input keyevent 82
#Lock your Android screen
adb shell input keyevent 6
adb shell input keyevent 26
#Open default browser
adb shell input keyevent 23
#Keep your android phone volume up(+)
adb shell input keyevent 24
#Keep your android phone volume down(-)
adb shell input keyevent 25
#Go to your Android Home screen
adb shell input keyevent 3
#Take Screenshot from adb
adb shell screenshot /sdcard/test.png
#Another Screen capture command
#screencap [-hp] [-d display-id] [FILENAME]
# -h: this message
# -p: save the file as a png.
# -d: specify the display id to capture, default 0
#start clock app
adb shell am start com.google.android.deskclock
#stop clock app
adb shell am force-stop com.google.android.deskclock
#start wifi settings manager
adb shell am start -a android.intent.action.MAIN -n com.android.settings/.wifi.WifiSettings
#Testing wifi status – Thanks Saimadhu
adb shell am start -n com.android.settings/.wifi.WifiStatusTest
Below commands only works on Rooted Devices – Thanks Pooja Shah for asking the questions
#wifi on
adb shell svc wifi enable
#wifi off
adb shell svc wifi disable
#Mobile Data on
adb shell svc data enable
#Mobile Data off
adb shell svc data disable
I hope some one will benefits 🙂
Hello. Thanks for posting your tips! Can you say me if there’s a adb command for display settings? I Have a Android 4.0 tablet that doesn’t show image on the screen and I’ve tested screens without success. I think that there’s some config error.
Thanks Arun, The info is helpful to me.
I would like to add 1 command test the wifi status:
adb shell am start -n com.android.settings/.wifi.WifiStatusTest
Your command updated 🙂
can you please tell me how to connect to a network after enabling wifi?
connecting to a network can be done thorugh manual selection. Changing the config files for wifi connection on a mobile device requires Root permission.
Hi Arun, thanks for documenting these useful commands.
I have a query, does switching on wi-fi via “adb shell svc wifi enable” works only on rooted device? or “svc” is something has to installed on the device. I’m trying the same command on nexus tab 4.4.2 & it doesn’t work
Thanks for asking this question. I just forget to mention that those commands only works on Rooted devices.
[…] https://thangamaniarun.wordpress.com/2013/04/19/useful-android-adb-commands-over-usbwi-fi/ […]
Hi Arun, Thanks for the useful commands.
May I know how to switch OFF/ON the wifi on Non-Rooted devices.
There is a way to turn wifi ON/OFF without root:
:: Sets Wifi on device (reboot is required)
:: num -> 1 (WiFi is ON)
:: num -> 0 (WiFi is OFF)
adb shell settings put global wifi_on num
adb reboot
[…] https://thangamaniarun.wordpress.com/2013/04/19/useful-android-adb-commands-over-usbwi-fi/ […]
help please how to put my radio on.. or my GSM Service: Radio on?
Use these commands;
1. adb shell settings put global airplane_mode_on 0
2. adb shell am broadcast -a android.intent.action.AIRPLANE_MODE –ez state false
Those command will turn off your airplane mode a.k.a turn on your GSM service etc
what is the adb command for to goto the data usage settings to enable the mobile data..
[…] https://thangamaniarun.wordpress.com/2013/04/19/useful-android-adb-commands-over-usbwi-fi/ […]
Hi Arun,
can you please help on below queries:
1. How to run iperf in Non-rooted devices
2. I tried below commands on Samsung mobile it shows below error can you please help me on this :
am start -a android.intent.action.MAIN -n com.android.settings/.wifi.WifiSettings
Starting: Intent { act=android.intent.action.MAIN cmp=com.android.settings/.wifi.WifiSettings }
Error type 3
Error: Activity class {com.android.settings/com.android.settings.wifi.WifiSettings} does not exist.
Sorry to say that I’m not in touch with these developments anymore. The recent versions might have changed lot. Please do your own search for the solution.