This document contains the ADB commands needed to grant the required permissions for the Network Switch app.
-
Enable Developer Options:
- Go to Settings → About Phone
- Tap "Build Number" 7 times
- Developer Options will appear in Settings
-
Enable USB Debugging:
- Go to Settings → Developer Options
- Enable "USB Debugging"
-
Install ADB:
- Download Android SDK Platform Tools
- Add ADB to your system PATH
- Or use Android Studio's built-in ADB
This is the main permission required for the app to function:
adb shell pm grant com.networkswitcher android.permission.WRITE_SECURE_SETTINGSCheck if the permission was granted successfully:
adb shell dumpsys package com.networkswitcher | grep "WRITE_SECURE_SETTINGS"adb shell settings put secure enabled_accessibility_services com.networkswitcheradb devicesExpected output should show your device as "device" (not "unauthorized").
adb shell pm list packages | grep networkswitcheradb shell settings get global preferred_network_modeadb shell settings get global preferred_network_mode15G Preferred:
adb shell settings put global preferred_network_mode 26
adb shell settings put global preferred_network_mode1 264G Only:
adb shell settings put global preferred_network_mode 11
adb shell settings put global preferred_network_mode1 115G Only:
adb shell settings put global preferred_network_mode 27
adb shell settings put global preferred_network_mode1 27To remove the permission:
adb shell pm revoke com.networkswitcher android.permission.WRITE_SECURE_SETTINGSFor wireless debugging without USB cable:
- Enable Wireless Debugging in Developer Options
- Connect via IP:
adb connect <device-ip>:5555
- Run commands as normal
| Mode | Value | Description |
|---|---|---|
| GSM Only | 1 | 2G only |
| GSM/WCDMA | 0 | 2G/3G |
| WCDMA Only | 2 | 3G only |
| GSM/WCDMA/LTE | 9 | 2G/3G/4G |
| LTE Only | 11 | 4G only |
| LTE/GSM/WCDMA | 12 | 4G/3G/2G |
| NR_LTE_GSM_WCDMA | 26 | 5G/4G/3G/2G (5G Preferred) |
| NR_ONLY | 27 | 5G only |
- Ensure Developer Options and USB Debugging are enabled
- Try different USB cable or port
- Check if device requires authorization prompt
- Check device for authorization prompt
- Revoke USB debugging authorizations and try again
- Ensure ADB is the latest version
- Ensure the app is installed:
adb install app-debug.apk - Check package name is correct
- Restart the Network Switch app
- Toggle airplane mode and back
- Reboot device if necessary
WRITE_SECURE_SETTINGSis a system-level permission- Only grant to trusted applications
- Permission persists until app is uninstalled or manually revoked
- Some OEMs may restrict this permission regardless
Instead of ADB, you can use Shizuku for a user-friendly permission management:
- Install Shizuku from Play Store
- Start Shizuku service (requires ADB once for setup)
- Use Network Switch app to request permission through Shizuku
This method is recommended for non-technical users as it provides a GUI for permission management.