AOSP 8.1设备开机自动开启热点自动化问题求助
Hey there! Sorry to hear MacroDroid isn't working out for your auto-hotspot-on-boot needs on your AOSP 8.1 device. Let's go through a few reliable, tested methods that should get this functionality up and running for you.
Method 1: Use Tasker (No Root Required, If You Can Sideload It)
Tasker tends to have better low-level system access than some automation apps, even on vanilla AOSP:
- First, sideload the Tasker APK onto your device (since AOSP 8.1 doesn't include Google Play, you'll need to grab a trusted APK file and install it via adb or a file manager).
- Open Tasker and create a new task—name it something like
StartHotspotOnBoot. - In the task editor, add the action
Net > WiFi Hotspot, set the toggle to Enabled, and save the task. - Create a new profile and select the trigger
Event > System > Device Boot. Link this profile to yourStartHotspotOnBoottask. - Reboot your device to test—Tasker should trigger the hotspot once the system finishes booting.
Method 2: Root-Required Shell Script (Init.d or Magisk Boot Script)
If your device is rooted, this is a more robust approach that bypasses third-party app limitations:
Option A: Using init.d
- Ensure your AOSP 8.1 system has init.d support enabled (most custom AOSP builds do, but if not, you can enable it via Magisk or a root-level manager).
- Using a root file manager or adb shell, navigate to
/system/etc/init.d/and create a new file named99_StartHotspot. - Paste the following script into the file (adjust the sleep time if your system takes longer to boot):
#!/system/bin/sh # Wait for system services to fully initialize sleep 40 # Enable WiFi hotspot directly via service call (works on most AOSP 8.1 builds) service call connectivity 34 i32 1 # Optional: Ensure hotspot settings are preserved (if you pre-configured SSID/password) settings put global tether_wifi_enabled 1 settings put global wifi_ap_enabled 1
- Grant execute permissions to the script:
chmod 755 /system/etc/init.d/99_StartHotspot
- Reboot your device—the script will run automatically on boot.
Option B: Using Magisk Boot Script (If You Use Magisk for Root)
- Open Magisk Manager, go to
Modules > + > Create a module(or use a file manager to navigate to/data/adb/service.d/). - Create a script file named
start_hotspot.shwith the same content as the init.d script above. - Set execute permissions:
chmod 755 /data/adb/service.d/start_hotspot.sh. - Reboot—Magisk will run this script during the boot process.
Method 3: Modify System Settings Database (Root Required)
If you just need a one-time setup that persists on boot, you can directly tweak the system settings database:
- Open a root shell (via adb or a terminal app on your device):
su
- Run these commands to enable the hotspot and make the setting stick:
settings put global tether_wifi_enabled 1 settings put global wifi_ap_enabled 1
- To ensure this applies on every boot, add these commands to an init.d or Magisk boot script as shown in Method 2.
Important Pre-Requisite
Before using any of these methods, manually configure your WiFi hotspot's SSID and password in the system settings first. This ensures the auto-enabled hotspot uses your preferred credentials instead of default open settings.
Let me know if you run into any issues with any of these steps—I’m happy to help troubleshoot further!
内容的提问来源于stack exchange,提问作者Pranjal




