tracer0tong / android-emulator Goto Github PK
View Code? Open in Web Editor NEWYet another Docker container with Android SDK and Android emulator
License: Apache License 2.0
Yet another Docker container with Android SDK and Android emulator
License: Apache License 2.0
Makefile debugged in boot2docker environment, but here can be some mistakes for clean docker installations on Linux.
hi, the java you use PPA -> java7 cannot download now , maybe you can update to java-8-oracle.
by the way, can you tell me what's the point that can use adb connect in Docker , I try like what you did, but it just can't connect . Is the "-usbdevice tablet" or "socat" or other, please tell me ,thank you.
Hi,
I just follow your introduction to install the emulator. But it shows device is offline after connected the emulator. Do you have meet this issue before ?
I've tried some ways to fix it, such as restart adb( adb kill-server & start-server) , delete .android/adbkey & adbkey.pub. But none work...
To avoid problems with Android SDK 32-bit toolchain I've used 32-bit old Ubuntu. I should add 32-bit support to my image based on Ubuntu 14.04
When you use this image in GITLAB, you get this error:
emulator: ERROR: Could not load OpenGLES emulation library: lib64OpenglRender.so: cannot open shared object file: No such file or directory
Can you help me?
image: tracer0tong/android-emulator:latest
stages:
build:
stage: build
script:
I'm having issues connecting to the devices from a windows host when the docker machine is running. Using the new linux subsystem in windows (ubuntu flavored) I can ssh in fine and poke around. I just don't know why it's complaining. The adb tools are on the windows host. Just for kicks and giggles though I tried to use the same tools through the linux subsystem and got similar results. I'm at a loss.
> docker ps
5972aa2fe34 tracer0tong/android-emulator "/entrypoint.sh" 31 minutes ago Up 31 minutes
0.0.0.0:32774->22/tcp, 0.0.0.0:32773->80/tcp, 0.0.0.0:32772->443/tcp, 0.0.0.0:32771->5037/tcp,
0.0.0.0:32770->5554/tcp, 0.0.0.0:32769->5555/tcp, 0.0.0.0:32768->5900/tcp android
adb connect
using 0.0.0.0> adb kill-server
> adb connect 0.0.0.0:32769
* daemon not running; starting now at tcp:5037
* daemon started successfully
unable to connect to 0.0.0.0:32769: cannot connect to 0.0.0.0:32769: The requested address is not
valid in its context. (10049)
adb connect
using IpAddress> docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' android
172.17.0.2
> adb kill-server
> adb connect 172.17.0.2:32769
* daemon not running; starting now at tcp:5037
* daemon started successfully
unable to connect to 172.17.0.2:32769: cannot connect to 172.17.0.2:32769: A connection attempt
failed because the connected party did not properly respond after a period of time, or established
connection failed because connected host has failed to respond. (10060)
netstat -a
Proto Local Address Foreign Address State
TCP 0.0.0.0:80 IVYSAUR:0 LISTENING
TCP 0.0.0.0:135 IVYSAUR:0 LISTENING
TCP 0.0.0.0:445 IVYSAUR:0 LISTENING
TCP 0.0.0.0:1536 IVYSAUR:0 LISTENING
TCP 0.0.0.0:1537 IVYSAUR:0 LISTENING
TCP 0.0.0.0:1538 IVYSAUR:0 LISTENING
TCP 0.0.0.0:1539 IVYSAUR:0 LISTENING
TCP 0.0.0.0:1540 IVYSAUR:0 LISTENING
TCP 0.0.0.0:1544 IVYSAUR:0 LISTENING
TCP 0.0.0.0:1546 IVYSAUR:0 LISTENING
TCP 0.0.0.0:1641 IVYSAUR:0 LISTENING
TCP 0.0.0.0:2179 IVYSAUR:0 LISTENING
TCP 0.0.0.0:8080 IVYSAUR:0 LISTENING
TCP 0.0.0.0:32768 IVYSAUR:0 LISTENING
TCP 0.0.0.0:32769 IVYSAUR:0 LISTENING
TCP 0.0.0.0:32770 IVYSAUR:0 LISTENING
TCP 0.0.0.0:32771 IVYSAUR:0 LISTENING
TCP 0.0.0.0:32772 IVYSAUR:0 LISTENING
TCP 0.0.0.0:32773 IVYSAUR:0 LISTENING
TCP 0.0.0.0:32774 IVYSAUR:0 LISTENING
TCP 0.0.0.0:46708 IVYSAUR:0 LISTENING
TCP 0.0.0.0:57621 IVYSAUR:0 LISTENING
.
.
.
TCP 127.0.0.1:22223 IVYSAUR:0 LISTENING
TCP 127.0.0.1:32774 IVYSAUR:57088 ESTABLISHED ### My SSH session
TCP 127.0.0.1:44430 IVYSAUR:0 LISTENING
.
.
.
I've been banging my head against the wall for quite some time now and any help towards getting adb to connect would be appreciated.
I got your docker image of android emulator: tracer0tong/android-emulator from github. I use it this way:
$ docker pull tracer0tong/android-emulator:latest
$ docker run -d -P --name android tracer0tong/android-emulator
$ docker ps –a
I get:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
a5f9318c6496 tracer0tong/android-emulator "/entrypoint.sh -e an" 25 minutes ago Up 25 minutes 0.0.0.0:32771->22/tcp, 0.0.0.0:32770->5554/tcp, 0.0.0.0:32769->5555/tcp, 0.0.0.0:32768->5900/tcp android
So, it seems working and it can provide adb ports.
4) $ adb connect 192.168.99.100:32769, it succeed
5) $ adb devices. It failed, does not display any information
I tried to play with this image for 2 days, used different ways , but can’t make it work.
I hope to get an android emulator that can support adb commands, so I can install software in it. And by using Appium, I can control this android emulator, just like I control android physical devices.
Hi Author,
it is possible to create several avd in the docker container manually and start them?
I tried the command in the entrypoint.sh, but failed.
echo "no" | /usr/local/android-sdk/tools/android create avd -f -n test2 -t ${EMULATOR} --abi default/${ARCH}
echo "no" | /usr/local/android-sdk/tools/emulator64-${EMU} -avd test2 -noaudio -no-window -gpu off -verbose -qemu -usbdevice tablet -vnc :0
I have reproduced the issue both on Mac & a linux VM for x-86 emulator.
Also the arm emulator did not work in Mac. The logs showed something like 'test image not found'
Optionally entrypoint could install http://www.onaips.com/wordpress/?page_id=60 (https://github.com/oNaiPs/droidVncServer) to emulator.
Currently the Dockerfile is based on latest ubuntu image
FROM ubuntu
and therefore may become unstable at some point in time.
Please consider changing to specific verified version of ubuntu
ex. ubuntu:16.04
.
when I try to connect android with VNC in port tcp/5900, I just connect to the mac itself, not the android in docker, why?
What is the added value of having the SSH server running inside the docker image?
The image can be easily accessed by calling
docker exec -it ${DOCKER_IMAGE_ID} bash
or
docker run -it ${DOCKER_IMAGE_ID} /bin/bash
What will be my ip to be configured in appium and url/ip to see the emulator in browser?
For some reason, the build just hangs. Do you happen to know what might cause this?
Hey, I am using your Dockerfile to build the image on my local machine with 24.2 android SDK version. When I try to run a container with that image, it raise KVM is not installed on this machine (/dev/kvm is missing)
, but when I change android SDK version back to 23, it works well. Any thing I missing? Why I can not upgrade the SDK here? :)
Google has system-images;android-24;default;arm64-v8a image that would be nice to utilize for testing 64bit arm native code in a CI situation.
I took a shot at it, but can't expose the emulator to other machines.
Things to note:
the android wrapper is deprecated (sdkmanager and it's new package name scheme can replace it's use in Dockerfile, and avdmanager can replace it's use in entrypoint.sh) The android tool doesn't like android-24,sys-img-arm64-v8a-android-24 (maybe new issue)
emulator64-arm moved (it's in $ANDROID_HOME/emulator now). There is a binary "emulator" that will start the image, but it hooks up the crash monitor and starts a local adb and I haven't found the magic to expose it to other machines (running Docker for Mac, current arm32 images work fine) or start it bare (the old emulator wrapper script seems to be a binary now that does some stuff I haven't dug into.)
When i trying to boot up the devices using CPU/ABI armeabi-v7a, 4GB RAM, 3GB Storage.
Its just hang on black screen,and nothing appear anymore,just blank
Preview:
https://media.discordapp.net/attachments/840846574925512735/842351704926453790/Screenshot_2021-05-13_184438.png
I tried to hold & presss the power button,nothing changed.Still BLANK.
I dont know why is this happening,please help!
(Its work before,but now it doesnt work.This is a new devices but with all same stuff)
Accordingly http://developer.android.com/about/dashboards/index.html switch to Android SDK number 19,21,22. Add support of ARM ABI as options.
Running Docker on Windows 10, started with
$ docker run -d -P --name android tracer0tong/android-emulator
docker ps shows the container and available ports just fine.
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
a494f19f07a4 tracer0tong/android-emulator "/entrypoint.sh" 32 minutes ago Up 32 minutes 0.0.0.0:32772->22/tcp, 0.0.0.0:32771->5037/tcp, 0.0.0.0:32770->5554/tcp, 0.0.0.0:32769->5555/tcp, 0.0.0.0:32768->5900/tcp android
When I try SSHing into it using user root it gives me "connection refused".
$ ssh [email protected] -p 32722
ssh: connect to host 0.0.0.0 port 32722: Connection refused
Trying to connect via VNC (using RealVNC client and port 5900) it gives me "denied by remote host".
I'm quite new to Docker and was wondering if it's possible to already install apks and add files to the emulator, and make a new image out of it, to avoid having to copy and reinstall things each time the container is started?
I tried doing a commit after adding apks and file, but when running the resulting image, no apk was installed and no file was there.
I was not able to mount any volumes into the image by specifying -v... option. Did I miss something or is this simply undoable the way I thought it should work out?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.