Many Android users need a hotspot that stays on even after the device restarts. By default Android disables the hotspot during a reboot and offers no UI option to make it permanent. This tutorial shows how to automate hotspot activation using only free tools, no root required.
When Android boots it restores the last known network state. The hotspot is considered a temporary tethering session, so the system turns it off to save battery and to avoid exposing the device unintentionally. Because the setting lives in the system’s secure storage, only privileged components can toggle it automatically.
pkg update && pkg upgrade -y
pkg install bash termux-api -y
adb shell pm grant com.termux android.permission.WRITE_SECURE_SETTINGS
If you have never used ADB before, install the platform‑tools package from Google and enable USB debugging on the phone.
~/.termux/boot/) and runs any executable script placed there each time the device boots.mkdir -p ~/.termux/boot
nano) and create a file called hotspot.sh inside the boot folder:
nano ~/.termux/boot/hotspot.sh
SSID and PASS to your preferred values (password must be at least 8 characters on Android 10+).
#!/data/data/com.termux/files/usr/bin/bash
# ---------------------------------------------------
# Persistent Wi‑Fi Hotspot script for Android (no root)
# ---------------------------------------------------
# Desired hotspot name and password – change these lines.
SSID="MyAndroidHotspot"
PASS="StrongPass123"
# Apply the SSID and password to the system settings.
settings put global tether_wifi_ssid "$SSID"
settings put global tether_wifi_password "$PASS"
# Enable the hotspot. The command varies slightly by Android version:
# Android 9‑10: svc wifi tether start
# Android 11+: cmd wifi tether start
# Try the newer command first; if it fails, the older one works on many devices.
if cmd wifi tether start 2>/dev/null; then
echo "Hotspot started via cmd wifi"
else
svc wifi tether start && echo "Hotspot started via svc wifi"
fi
exit 0
nano).chmod +x ~/.termux/boot/hotspot.sh
~/.termux/boot/hotspot.sh
logcat -d | grep -i tether
and look for error messages. Common issues are missing permissions (repeat the ADB grant) or a typo in the command.
~/.termux/boot/. Termux:Boot will not run scripts placed elsewhere.svc wifi tether start. Edit hotspot.sh and replace the cmd wifi tether start line with the older command.
If your device blocks the cmd wifi tether command even after granting WRITE_SECURE_SETTINGS, consider one of the following:
netd service, you can start the hotspot via am startservice -n com.android.settings/.TetherService. This method is less reliable across Android versions.~/.termux/boot/hotspot.sh. Protect your phone with a strong lock screen and avoid sharing the script file.WRITE_SECURE_SETTINGS gives Termux a high level of system access. Only install Termux from trusted sources (F‑Droid or the official Play Store) and keep the app updated.Once the steps are complete, your Android device will automatically turn on the Wi‑Fi hotspot with the SSID and password you defined, every time it boots. Connected devices will retain network access unless the hotspot is manually turned off or the device runs out of power.
This solution works on most Android 9 (Pie) and newer devices. Older versions may require a slightly different command (svc wifi tether start) and may not allow the WRITE_SECURE_SETTINGS grant without a rooted device.
Enjoy a hands‑free hotspot that’s ready whenever you need it – all without rooting your phone.









