Most Android phones let you share their mobile data via the built‑in hotspot feature. However, the UI often imposes carrier‑imposed limits, requires a PIN, or disables the hotspot after a reboot. Using adb (Android Debug Bridge) you can:
This tutorial walks you through the entire process, from preparing your device to troubleshooting common failures.
Prerequisites
adb installed. (If you don’t have it yet, download the Platform‑Tools package from the Android developer site and unzip it.)Leaving USB debugging on all the time can expose your device to accidental ADB commands if you plug it into an untrusted computer. Consider disabling it after you finish.
C:\adb or ~/adb.cd path/to/platform-tools
adb devices. You should see a line like:
List of devices attached
1234567890ABCDEF device
If you see unauthorized, check your phone – a dialog will ask you to allow the computer’s RSA key. Tap Allow and optionally tick “Always allow from this computer”.
Many carriers set the system property net.tethering.noprovisioning to block hotspot usage. You can clear this flag with a single ADB command:
adb shell settings put global tether_dun_required 0
This tells Android that a “Dial‑up‑Network” (DUN) connection is not required, effectively bypassing the carrier check. The change is stored in the global settings database and survives reboots.
Android stores hotspot configuration in a single JSON string under the key tether_wifi_ap_config. You can write a new configuration with settings put global. Replace the example values with your own.
adb shell settings put global tether_wifi_ap_config '{"SSID":"MyHotspot","Password":"StrongPass123","SecurityType":3}'
Explanation of the fields:
If you ever need to read the current configuration, run:
adb shell settings get global tether_wifi_ap_configWith the configuration in place, start the hotspot using the cmd wifi service:
adb shell cmd wifi start-softap
After a few seconds you should see the hotspot icon in the status bar. On most devices you can verify it by pulling down the quick‑settings panel – the “Hotspot” tile will be highlighted.
Android does not allow a true “always‑on” hotspot without root, but you can simulate persistence by running a short script on your PC each time the device connects via USB. Create a file called hotspot_on.bat (Windows) or hotspot_on.sh (macOS/Linux) with the following content:
# Windows batch example (hotspot_on.bat)
@echo off
adb wait-for-device
adb shell cmd wifi start-softap
For Linux/macOS:
#!/bin/bash
adb wait-for-device
adb shell cmd wifi start-softap
Make the script executable (chmod +x hotspot_on.sh) and place it in a convenient folder. Whenever you plug the phone in, run the script – it will wait for the device, then turn the hotspot back on. You can even add the script to your OS’s “autostart” or “login items” so it runs automatically when you start your computer.
Because the hotspot is started from the host PC, the phone must stay connected via USB for the script to work. If you need a completely autonomous solution you will have to use a third‑party automation app (e.g., Tasker) with the adb shell cmd wifi start-softap command granted via ADB.
adb shell settings get global wifi_on. If it returns 0, enable Wi‑Fi first: adb shell svc wifi enable.The configuration you saved in Step 4 persists across reboots, but the hotspot service itself does not start automatically. The only reliable way to have it on after a reboot without root is to use a PC‑side script (Step 6) or a local automation app with the appropriate ADB permission.
Make sure USB debugging is still enabled (some devices turn it off after a reboot). Also verify that the RSA key prompt on the phone was accepted. If the prompt never appears, try disconnecting and reconnecting the USB cable while the phone is unlocked.
By following the steps above you can quickly enable a Wi‑Fi hotspot on any Android phone, set a custom SSID/password, and work around carrier restrictions – all without rooting the device. While true always‑on hotspot requires root, the simple PC‑side script gives you a practical “persistent” experience for everyday use.
Feel free to adapt the JSON configuration in Step 4 for different SSIDs or security levels, and keep the adb commands handy for future devices. Happy sharing!









