1

Is it possible to control or monitor

  • airplane mode
  • WiFi
  • Data/3G connection

of an Android phone (e.g. Samsung Galaxy or OnePlus One) running CyanogenMod, from a Windows PC or a Mac?

I want to connect the android phone to my computer and monitor it from there using a driver.

  • Probably, but you need to be more specific about "the phone"? – slhck Oct 14 '14 at 13:59
  • Just a regular android phone such as Samsung Galaxy, or the OnePLus One (oneplus.net/de/one) – user670186 Oct 14 '14 at 14:01
2

It's possible using the Android debugging bridge, for example for WiFi and 3G/data:

adb shell svc wifi enable
adb shell svc wifi disable

adb shell svc data enable
adb shell svc data disable

Other services can be enabled/disabled. Look at the list using:

adb shell service list

To toggle Airplane mode:

adb shell am start -a android.settings.AIRPLANE_MODE_SETTINGS & adb shell input keyevent KEYCODE_ENTER & adb shell input keyevent 4

The phone obviously needs to have debugging enabled and you need to install adb with the Android SDK (the SDK tools at the bottom of the page will be enough).

| improve this answer | |
1

For switching the Airplane mode, I would rather use the following than trying to manipulate the GUI programmatically.

To enable the Airplane mode:

adb shell settings put global airplane_mode_on 1
adb shell am broadcast -a android.intent.action.AIRPLANE_MODE

To disable the Airplane mode:

adb shell settings put global airplane_mode_on 0
adb shell am broadcast -a android.intent.action.AIRPLANE_MODE

As slhck wrote, you need adb (Android Debugging Bridge) from the Android SDK.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.