- preparation:
- a. make sure you have install docker,
- run the command:
docker run -d \
--network=host \
-e ADBKEY="$(cat ~/.android/adbkey)" \
--device /dev/kvm \
--cpus="4" \
--publish 8554:8554/tcp \
--publish 5555:5555/tcp \
--name android-emulator-30 \
us-docker.pkg.dev/android-emulator-268719/images/30-google-x64:30.1.2
adb connect localhost:5555
adb wait-for-device
- and then, enjoy it.
- a. How stop and start?
docker container stop android-emulator-30
docker container start android-emulator-30
- b. how to oversee the device's screen?
as soon as your emulator started,you can use scrcpy to oversee it in terminal.
scrcpy --max-fps 15
- bugs
If you encouter problem: adb: error: stat failed when trying to push to /data/local/tmp/scrcpy-server.jar: Permission denied
or not a directory
, you can try steps below to fix them.
a. run command adb reboot
b. try to run scrcpy --max-fps 15
when system just started. You may need to run it many times.