3

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.

Scorb
  • 1,654
  • 13
  • 70
  • 144

2 Answers2

14

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->Press and hold power button->Hold for Assistant

miguel
  • 16,205
  • 4
  • 53
  • 64
  • 4
    I can't believe (ok I can, It's Google) that they actually made it so that when you start an emulator you can't shut it down without diving into the settings to disable this stupid feature. How did nobody think of this? – aaronmarino Jul 29 '22 at 10:54
  • This setting does not exist for me. In 'Power menu' I only have 'Device Controls'. – Scorb Sep 26 '22 at 22:33
-2
  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
zzjtnb
  • 1
  • 1