google / android-emulator-container-scripts

1.88k stars 262 forks source link

Support for android tv #146

Open vaclavbenes opened 4 years ago

vaclavbenes commented 4 years ago

Hi, is it possible add support for android tv ?

pokowaka commented 4 years ago

Yes. Which AVD from Android Studio are you currently using?

vaclavbenes commented 4 years ago

We are testing api 22+ (all of them) , but what miss is api + playstore.

Screenshot 2020-06-17 at 09 31 15

I d like to go official way, if its possible plus use it in docker.

veryhumble commented 3 years ago

Hi @vaclavbenes ,

did you manage to create an androidtv docker image?

Before I go down the rabbit hole. @pokowaka will androidtv images be listed as supported when I do emu-docker list ?

regards

vaclavbenes commented 3 years ago

@veryhumble No i didnt i found this part of code

python emu_downloads_menu.py

SYSIMG_REPOS = [
    "https://dl.google.com/android/repository/sys-img/android/sys-img2-1.xml",
    "https://dl.google.com/android/repository/sys-img/google_apis/sys-img2-1.xml",
    "https://dl.google.com/android/repository/sys-img/google_apis_playstore/sys-img2-1.xml",
]

maybe its possible add

Screenshot 2021-02-11 at 21 59 28
veryhumble commented 3 years ago

@vaclavbenes It is possible. We have a working image with an Android TV image (28) on GCE.

@mightea opened the PR to add the necessary changes. Check it out if you want to give it a try.

vaclavbenes commented 3 years ago

@veryhumble android tv is not system image , I try build it with it . @pokowaka is sys-img-android-tv-28-p-x86.zip system img.

╰─$  cd /Users/vaclav.benes/Git/avast-mobile/android-emulator-container-scripts ; /usr/bin/env /Users/vaclav.benes/Git/avast-mobile/android-emulator-container-scripts/venv/bin/python /Users/vaclav.benes/.vscode-insiders/extensions/ms-python.python-2021.3.658691958/pythonFiles/lib/python/debugpy/launcher 57057 -- ./venv/bin/emu-docker create emulator-linux-30.4.5.zip sys-img-android-tv-28-p-x86.zip --gpu --tag latest 
WARNING:Please opt in or out of metrics collection.
You will receive this warning until an option is selected.
To opt in or out pass the --metrics or --no-metrics flag
Note, that metrics will only be collected if you opt in.
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/Users/vaclav.benes/.vscode-insiders/extensions/ms-python.python-2021.3.658691958/pythonFiles/lib/python/debugpy/__main__.py", line 45, in <module>
    cli.main()
  File "/Users/vaclav.benes/.vscode-insiders/extensions/ms-python.python-2021.3.658691958/pythonFiles/lib/python/debugpy/../debugpy/server/cli.py", line 444, in main
    run()
  File "/Users/vaclav.benes/.vscode-insiders/extensions/ms-python.python-2021.3.658691958/pythonFiles/lib/python/debugpy/../debugpy/server/cli.py", line 285, in run_file
    runpy.run_path(target_as_str, run_name=compat.force_str("__main__"))
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 268, in run_path
    return _run_module_code(code, init_globals, run_name,
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 97, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "./venv/bin/emu-docker", line 33, in <module>
    sys.exit(load_entry_point('emu-docker', 'console_scripts', 'emu-docker')())
  File "/Users/vaclav.benes/Git/avast-mobile/android-emulator-container-scripts/emu/emu_docker.py", line 286, in main
    args.func(args)
  File "/Users/vaclav.benes/Git/avast-mobile/android-emulator-container-scripts/emu/emu_docker.py", line 98, in create_docker_image
    raise Exception("{} is not a zip file with a system image".format(img))
Exception: sys-img-android-tv-28-p-x86.zip is not a zip file with a system image
'Pkg.Desc'
'Android SDK Platform 9'`
veryhumble commented 3 years ago

https://github.com/google/android-emulator-container-scripts/pull/237 was merged. So if you use emu-docker interactive according to the Readme, you should be able to choose an android tv image.

vaclavbenes commented 3 years ago

its solved with #238 .