Android emulator power off button does not work when using avd with system image > android 30

Viewed 285

I am using avdmanager to create an avd to run with the latest android emulator on Ubuntu 21.10.

I am using Android emulator version 31.2.8.

When I create and avd with system image 28...

avdmanager create avd -n pixel_5 -k "system-images;android-28;google_apis_playstore;x86_64" --device "pixel_5"

and run it..

emulator -avd pixel_5

I can then subsequently hold the power button, and the android OS on the emulator properly powers off.

When I create and avd with system image 30 or 31...

avdmanager create avd -n pixel_5 -k "system-images;android-31;google_apis_playstore;x86_64" --device "pixel_5"

Once the emulator starts, the power button does absolutely nothing, if I click on long click.

2 Answers

It's because a bad person at Google decided that the power button should trigger the Google Assistant. You can un-break it in Settings->System->Gestures->Power menu->Hold for Assistant

  1. Find your avd path(default~/.android/avd)
  2. Find the AVD name (your is pixel_5)
  3. Open the folder and find config.ini
  4. Edit hw.keyboard = yes
Related