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.

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

2 Answers 2

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).

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .