0

I know this question has allready been answered like in Turning airplane mode on via ADB. However, with Android 7 (Nougat) and above the suggested methode doesn't work. I get following error.

enter image description here

Is there a workaround for this?

Does this effect the broadcasting over adb for Android Nougat in generall?

Thanks in advance.

Community
  • 1
  • 1
Foster
  • 25
  • 2
  • 9

3 Answers3

1

According to Android documentation it seems you can't :

This is a protected intent that can only be sent by the system.

Omar Aflak
  • 2,918
  • 21
  • 39
0

I created a script for Noughat. Works on Samsung. Have to test on others.

#!/bin/bash

adb -s $1 shell am start -a android.settings.AIRPLANE_MODE_SETTINGS

sleep 5 adb -s $1 shell input tap 100 750 sleep 2

adb -s $1 shell input keyevent 21

adb -s $1 shell input keyevent 21

sleep 2

adb -s $1 shell input keyevent 22

sleep 5

adb -s $1 shell input keyevent KEYCODE_ENTER

sleep 5

adb -s $1 shell input keyevent 4

sleep 5

Thejus Krishna
  • 1,755
  • 1
  • 19
  • 28
0

I put this in a script on my OnePlus 5 running Nougat (Android 7.1) and it turns on Airplane Mode

input keyevent KEYCODE_WAKEUP;
sleep 0.5;
input keyevent KEYCODE_MOVE_HOME;
am start -a android.settings.AIRPLANE_MODE_SETTINGS;
sleep 0.5;
input tap 100 350;
sleep 1;     
input keyevent 4;