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

前端 未结 2 921
孤独总比滥情好
孤独总比滥情好 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条回答
  •  慢半拍i
    慢半拍i (楼主)
    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

提交回复
热议问题