How to turn off Wifi via ADB?
Using "svc" through ADB (rooted required):
Enable:
adb shell su -c 'svc wifi enable'
Disable:
adb shell su -c 'svc wifi disable'
Using Key Events through ADB:
adb shell am start -a android.intent.action.MAIN -n com.android.settings/.wifi.WifiSettings
adb shell input keyevent 20 & adb shell input keyevent 23
The first line launch "wifi.WifiSettings" activity which open the WiFi Settings page. The second line simulate key presses.
I tested those two lines on a Droid X. But Key Events above probably need to edit in other devices because of different Settings layout.
More info about "keyevents" here.
android adb turn on wifi via adb
Unfortunately the only way I could resolve my problem is to root the device.
Here is a good tutorial for Nexus S:
http://nexusshacks.com/nexus-s-root/how-to-root-nexus-s-or-nexus-s-4g-on-ics-or-gingerbread/
Turning off ADB over WiFi through ADB shell?
adbd
is the adb daemon that runs on your devices, awaiting connection.
issuing stop adbd
should kill it - you may have to run this as root, should stop adb on the device, and disconnect your active shell.
edit
just tried this and it worked for me, running cyanogenmod. using adb connect <ip>
, and entering an adb shell, su
for super user privileges, and then issue stop adbd
. your shell should terminate, and you will not be able to reconnect until you restart it from your device. (shell or settings menu)
Disable wireless Android(ADB) debugging without root
To disable, run the command adb usb
adb usb : Restart the adb server listening on USB.
This is listed on the official android site
Disable ADB over wifi but leave connection over USB functioning
Khadas Vim3 have info about adb tcp port stored in file /vendor/build.prop.
To edit this file first remount /vendor directory writable.mount -o rw,remount /vendor
Then edit build.prop file vi /vendor/build.prop
and change value for option
service.adb.tcp.port to -1. Former value is 5555
New value: service.adb.tcp.port=-1
Then remount /vendor as read only mount -o ro,remount /vendor
And reboot device.
After that adb no longer connects to device through wifi but can connect through usb.
Related Topics
Position of Dialogfragment in Android
What Is the Default Font Family in Android
View with Horizontal and Vertical Pan/Drag and Pinch-Zoom
Android Hello, Gallery Tutorial -- "R.Styleable Cannot Be Resolved"
Camera.Setparameters Failed in Android
How to Disable Future Dates in Android Date Picker
Sms Delivery Report in Android
Google Sceneform - Is It Deprecated? Any Replacement
How to Block Outgoing Calls and Text Sms
Android How to Programmatically Hide Launcher Icon
How to Read and Edit Android Calendar Events Using the New Android 4.0 Ice Cream Sandwich API
Ontouchevent Not Working on Child Views
Androidstudio - Module Dependencies in Gradle
Android Studio 3.1 Cannot Resolve Symbol (Themes, Widget, Attr, etc.)
Admob Shows Test Ads But Not Real Ads
Android Upload Video to Remote Server Using Http Multipart Form Data