Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android emulator 2.0 crash when press power button

I'm using android emulator 2.0, all things is up-to-day. Device's details:

Name: Nexus_5X_API_23
CPU/ABI: Google APIs Intel Atom (x86)
Path: /home/khang/.android/avd/Nexus_5X_API_23.avd
Target: google_apis [Google APIs] (API level 23)
Skin: nexus_5x
SD Card: /home/khang/.android/avd/Nexus_5X_API_23.avd/sdcard.img
hw.dPad: no
runtime.network.speed: full
hw.accelerometer: yes
hw.device.name: Nexus 5X
vm.heapSize: 100
hw.device.manufacturer: Google
hw.gps: yes
image.androidVersion.api: 23
hw.audioInput: yes
image.sysdir.1: system-images/android-23/google_apis/x86/
tag.id: google_apis
hw.camera.back: emulated
hw.mainKeys: no
AvdId: Nexus_5X_API_23
hw.camera.front: emulated
hw.lcd.density: 420
runtime.scalefactor: auto
avd.ini.displayname: Nexus 5X API 23
hw.gpu.mode: auto
hw.device.hash2: MD5:1be89bc42ec9644d4b77968b23474980
hw.ramSize: 1536
hw.trackBall: no
hw.battery: yes
hw.cpu.ncore: 2
hw.sdCard: yes
tag.display: Google APIs
runtime.network.latency: none
hw.keyboard: yes
hw.sensors.proximity: yes
disk.dataPartition.size: 800M
hw.sensors.orientation: yes
avd.ini.encoding: UTF-8
hw.gpu.enabled: yes

I try to test my broadcast receiver which catch Lock/Unlock screen action. But I can't simulate it in Emulator 2.0 because whenever I press power button (or Ctrl P), android emulator auto close (no error message).

I thought power button cause the problem, but when I install an app which can force device sleeping (lock screen), my android emulator continue closing without any log or error message.

Have anyone known that problem? Ask me if you want to get more detail.

like image 405
Khang .NT Avatar asked Oct 19 '22 11:10

Khang .NT


1 Answers

For the AVD config of the device you are running, edit the below Advanced settings:

Emulated-Performance:: Graphics: Hardware

Emulated-Performance:: Boot Option: Cold Boot

Emulated-Performance:: Multi-Core: 4 (max on my system)

like image 121
Jithin Jude Avatar answered Oct 29 '22 20:10

Jithin Jude