0

I was trying to start emulator with the following command.

/home/shahrear/Android/Sdk/emulator/emulator -avd Pixel2_API_29 -no-window 

But I was getting the following errors. Without the no-window option it works fine but I need to start it in headless mode.

pulseaudio: Failed to initialize PA contextaudio: Could not init `pa' audio driver
E1008 14:00:45.458379787   17283 socket_utils_common_posix.cc:201] check for SO_REUSEPORT: {"created":"@1602144045.458354128","description":"SO_REUSEPORT unavailable on compiling system","file":"/mnt/tmpfs/src/android/emu-master-dev/external/grpc/src/core/lib/iomgr/socket_utils_common_posix.cc","file_line":169}

and adb devices showing offline

enter image description here

Shahrear Bin Amin
  • 1,075
  • 13
  • 31
  • [Run Android emulator without GUI (headless Android)](https://stackoverflow.com/q/20869067/3290339) – Onik Oct 08 '20 at 09:22

1 Answers1

0

I solved this issue with the following 2 commands:

echo yes | /bin/Android/Sdk/tools/bin/sdkmanager --licenses
touch /home1/www/.android/repositories.cfg

Refer to: Stuck at ".android/repositories.cfg could not be loaded."

Plus, you could possibly remove the audio error by specifying -noaudio.

For example,

emulator @Nexus_5X_API_23 -noaudio

Refer to: https://developer.android.com/studio/run/emulator-commandline

John
  • 1,139
  • 3
  • 16
  • 33