-
-
Notifications
You must be signed in to change notification settings - Fork 219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Emulator does not show any graphics #37
Comments
Hi @aerymilts, I'm currently in the hospital and will check this once I'm back home. In general, I've tested the container on my side before publishing it, I can view the emulator, interact with the emulator via mouse, and also run UI test on the emulator. BTW, the warning you've got is not a big deal, you can totally ignore that. Another matter is, virtualizing an ARM-based emulator, inside a docker container is a quite expensive action, for sure it will be slow. It may take even a few minutes before the real Android screen gets rendered properly. I'll try to reproduce using the steps you've provided, and share the updates here. |
Hey @thyrlian, I'm sorry to hear that you're in hospital. I hope you get well soon. I've tried leaving the emulator to start and render for up to half an hour at a time but nothing shows up. Not sure if this bit of information helps, but I have also tried installing packages from the container and that didn't work. I'm wondering if this is a sign that the emulator hasn't booted properly. root@20448ea13e96:$ adb install com.amazon.kindle.apk
Performing Streamed Install
adb: failed to install com.amazon.kindle.apk: Can't find service: package As a thought, would running dind (Docker in Docker) allow for virtualizing an x86-based emulator instead? I intend to use the emulator to use apps that have better support on mobile vs desktop. I didn't say this the first time round, but fantastic job on this repository and the support you're providing. I saw the level of details you were providing (and spelling out, in some cases) in the other resolved issues. 👍 |
Thank you @aerymilts for your acknowledgement and good wishes. I'm getting better now so I've played a bit. By following the same steps you've listed, I'm able to launch the emulator and interact with it as well. And I've tried both of the rendering options below, none of them has a problem. emulator -avd 24_test -no-audio -no-boot-anim -gpu off &
emulator -avd 24_test -no-audio -no-boot-anim -accel on -gpu swiftshader_indirect & As I said before, the virtualization inside Docker container is quite expensive, the bootup (readiness) of the emulator may take some minutes, which varies between machines (for instance: MacMini is way faster than MacbookPro). In fact, on my MacbookPro I haven't been waiting too long. And the other error message you've given - |
Hey @thyrlian, appreciate you testing out my scripts on your setup. Good to know I've set it up correctly and it's just down to the hardware. It appears that my GPU is not shared with the container. I managed to get the emulator going by disabling automatic graphics switching. The interface is incredibly slow, as you've pointed out before. Re: dind, I just went over the Emulator section again. Does this mean that there's absolutely no way for a Mac user to run x86 emulators (short of dual booting into Linux)? I did find that there are paid options out there that enabled nested virtualization but it seems like there's not much support for this. I don't have any knowledge in this area - do you have any recommendations/thoughts? |
Hi @aerymilts, it's really good to hear that now it works for you after your magic tweak on your host machine. I'd like to copy the screenshot here from the link you've given, for other users' reference, because Apple moves its "permalink" often. Actually this is something new to me since my MacbookPro only has an integrated graphic card, I don't even have such option (meaning the performance on my machine should be worse than yours, still I'm able to run UI test under acceptable timing). Regarding dind:
|
@thyrlian, go for it. I hope this is helpful for someone else in the future as well. 😄 That's interesting. I think the reason why it doesn't work on my integrated graphics is because I have a bad habit of leaving my laptop on for weeks at a time, so there's usually resource leaks which doesn't work very well for high performing apps. For reference, here are the stats of my MBP
Thanks for sharing, that's where I ended up as I went down the rabbit hole. I'm pretty much stuck as virtualization and architectures is way out of depth for me.
My intent is to build an emulator that allows me to use mobile apps that requires low to moderate resources (think: smooth paging for Kindle for Android on an emulator), using open source tools, high reproducibility (container as code) and is easy to port across OSes. That's how I got to Docker and your project. I also came across BlueStacks which serves my purpose pretty well (in fact it seems like it's meant for high performance mobile gaming). It's just that it's not open source and it doesn't have high configurability. I initially thought that I'd just have to go deeper into Docker to find the right setup to get it to work just like how BlueStacks does it. But it seems like there are limitations with Docker that just doesn't allow it. Is my understanding accurate? |
I just realised, did you mean to say that using the x86 emulator with Android Studio natively on my MBP would work? edit: From the Emulation section:
Just realised that this means I would be able to use an x86 emulator only if Docker isn't running. |
For my integrated graphics card, I also tend to leave my laptop running/hibernating for weeks, but I haven't run into any problem launching emulator inside a container. I got your purpose now, and I don't think emulator in container is a good solution for you. Please go and give a try of the x86 emulator from Android Studio, that should serve your needs. |
Sorry for the late response. Yes, it seems that accelerated containerised emulation for Mac is a convoluted solution at best. Thank you for helping me with this! |
Description
Emulator shows black screen
Steps to reproduce the issue
I've also tried toggling various gpu options and different system images to no avail.
The output looks like that
![image](https://user-images.githubusercontent.com/24253983/84161293-b452c000-aaa1-11ea-9e4f-0b711c4e3b58.png)
But rerunning the script a second time round gives just this, without the 'emulator out of date' output
![image](https://user-images.githubusercontent.com/24253983/84161564-faa81f00-aaa1-11ea-87a4-dbd6ed57e9f3.png)
Describe the results you expected
The ability to use the emulator through VNC visually.
The text was updated successfully, but these errors were encountered: