Adb Commands For Airplane mode and enable disable wifi, bluetooth
Adb commands for airplane mode consists of of two commands. One changes the state and another broadcast the intent. Wifi enable and disable is simple which i will explain at the end.
1. How to turn on airplane mode using adb commands.
The first command just changes the state of the Airplane mode icon but all radios are still active. Now you need to broadcast the intent right after the setting has been changed to inform the applications that the Airplane mode state has changed. The second line does broadcast the intent. So, you have to run both the commands in sequence.
adb shell settings put global airplane_mode_on 1
adb shell am broadcast -a android.intent.action.AIRPLANE_MODE
2. Turn off airplane mode using adb commands
adb shell settings put global airplane_mode_on 0
adb shell am broadcast -a android.intent.action.AIRPLANE_MODE
3. How to Enable wifi using adb commands
adb shell svc wifi enable
4. How to Disable wifi with adb command
adb shell svc wifi disable
If you see something like “sh: resetreason: can’t execute: Permission denied” run adb root command before running any commands.
5. How to turn on Bluetooth ?
To use these adb commands, you need to have root permission and your android build should be userdebug.
adb root adb shell service call bluetooth_manager 6
6. How to turn off Bluetooth
$adb root
$adb shell service call bluetooth_manager 6
Click here for List of Adb commands.
If you face any problem in running Adb Commands For Airplane mode, wifi or bluetooth. Please comment below and we will try to resolve.
How to enable airplane mode in non rooted android device using adb commands without using GUI method like input keyevent or tap x y.
Android version: 10
command tried:
settings put global airplane_mode_on 0; am broadcast -a android.intent.action.AIRPLANE_MODE –ez state false
issue while using above commands:
java.lang.SecurityException: Permission Denial: not allowed to send broadcast android.intent.action.AIRPLANE_MODE from pid=25344, uid=2000
at com.android.server.am.ActivityManagerService.broadcastIntentLocked(ActivityManagerService.java:17980)
at com.android.server.am.ActivityManagerService.broadcastIntentLocked(ActivityManagerService.java:17784)
at com.android.server.am.ActivityManagerService.broadcastIntent(ActivityManagerService.java:18702)
at com.android.server.am.ActivityManagerShellCommand.runSendBroadcast(ActivityManagerShellCommand.java:720)
at com.android.server.am.ActivityManagerShellCommand.onCommand(ActivityManagerShellCommand.java:185)
at android.os.ShellCommand.exec(ShellCommand.java:104)
at com.android.server.am.ActivityManagerService.onShellCommand(ActivityManagerService.java:12424)
at android.os.Binder.shellCommand(Binder.java:916)
at android.os.Binder.onTransact(Binder.java:790)
at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:5475)
at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:3426)
at android.os.Binder.execTransactInternal(Binder.java:1056)
at android.os.Binder.execTransact(Binder.java:1029)