Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Segmentation Fault trying to set battery level in android emulator

I am using Android SDK tools on Ubuntu. I have created a Nexus One Virtual Device that uses API-17. I run this emulator which attaches to port 5554.

After this, I connect to this port using telnet, and try to set power level:

power capacity 40

But, when I do this, I get segmentation and emulator gets killed. Also, when I goto Settings > Battery in emulator, it shows "Battery Status Not Available" and battery is 0%.

enter image description here

All other commands work, except the power related ones. What should I do?

like image 693
Shashank Jain Avatar asked Dec 20 '22 05:12

Shashank Jain


1 Answers

I just had the same problem and luckily found a solution.

  1. Go to your Android Virtual Devices folder. On Windows 7 it's this folder for example:

    C:\Users\{yourUserName}\.android\avd\{yourAVDName}.avd

  2. Open the config.ini file

  3. Set the battery option to yes: hw.battery=yes
  4. Restart your Virtual Device and be happy :-)

It has been raised as an issue already, but I'm not sure why they didn't fix it yet.

like image 88
imwill Avatar answered Dec 28 '22 07:12

imwill