how to see adb devices on linux container when host is windows 7 machine

前端 未结 2 898
孤独总比滥情好
孤独总比滥情好 2021-01-27 02:04

i have a windows 7 machine with docker tool box installed

i downloaded image and running container which have adb installed in it from below link

相关标签:
2条回答
  • 2021-01-27 02:20

    -p 5037:5037 is for seeing devices whis is running on container when typing adb devices on the host. But you would see devices connected on the host when you type adb devices in the container. For this

    1. Install ssh server on your host which is win 7 then from your container forwarding the port 5037. Run like:

    $ ssh -T -N -L5037:127.0.0.1:5037 root@host.ip host.ip may be: 192.168.0.10

    1. install ssh server on your container but first expose the container port 22 mapping 5022 on your host. (After configuring your /etc/ssh/sshd_config file). Run like: $ ssh -T -N -R5037:127.0.0.1:5037 root@127.0.0.1 -p 5022 in your host for remote forwarding.

    Before one option of two, you shoul map the port 8081 on your host like: -p8081:8081

    So you just need to run:

    docker run -p8081:8081 android_container
    

    then

    docker exec -it 9ba51613a7be adb devices
    

    if you forwarded ports.

    You have also another solution for this. Please check this repo: RN-Container-with-ADB-Real-Device

    0 讨论(0)
  • 2021-01-27 02:31

    Just to add conclusion of this question.

    Till date,I was not able to find a feasible solution to run windows docker on windows 7 machine. Most of the posts have been around windows docker with windows 10 and windows 2016 Server.

    I switched to Linux docker on windows 7 machine, However the adb devices were still not recognized on Linux container

    Lastly , i had to go for Linux host and Linux Container and the devices were visible on container.

    0 讨论(0)
提交回复
热议问题