Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simulate the connect and disconnect of the charging cable on the Android emulator

How can I simulate the connection and the disconnection of the charging cable on the Android emulator?

like image 508
poiuytrez Avatar asked Feb 08 '23 21:02

poiuytrez


2 Answers

With the new emulator introduced in Android Studio 2.0 you can switch connection status easily on emulator extended controls.

enter image description here

like image 79
pablobu Avatar answered Feb 11 '23 14:02

pablobu


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
like image 31
Meltzer Avatar answered Feb 11 '23 16:02

Meltzer