问题
How can I simulate the connection and the disconnection of the charging cable on the Android emulator?
回答1:
With the new emulator introduced in Android Studio 2.0 you can switch connection status easily on emulator extended controls.
回答2:
From : http://developer.android.com/tools/help/emulator.html#power
On command line call:
telnet localhost 5554
and then:
power ac off
power ac on
来源:https://stackoverflow.com/questions/32888848/simulate-the-connect-and-disconnect-of-the-charging-cable-on-the-android-emulato