ccarcaci / andocker

10 stars 5 forks source link

adb: computer is not authorized to debug the device #5

Closed Shuunen closed 4 years ago

Shuunen commented 4 years ago

Hi there,

Thanks for sharing this project, I'd like to setup this for my project too,

I follow the readme to start everything and got this error :

Couldn't start project on Android: Error running adb: This computer is not authorized to debug the device.

Any ideas ?

Regards

ccarcaci commented 4 years ago

Hello @Shuunen thank you for using this project, feel free to fork and extend it as you prefer :)

I've done some verifications and everything seems to be working good. Could you please share some screens? If you have any code or other elements that could help to clarify the issue please share.

Thank you

Shuunen commented 4 years ago

Sure,

I git clone this project on the master branch and follows the readme, so I don't have specific code to share.

Here is the result from npx envinfo :

 System:
    OS: Windows 10
    CPU: (6) x64 Intel(R) Core(TM) i5-9600K CPU @ 3.70GHz
    Memory: 6.21 GB / 15.93 GB
  Binaries:
    Node: 12.16.1 - C:\Program Files\nodejs\node.EXE
    npm: 6.13.4 - C:\Program Files\nodejs\npm.CMD
  Managers:
    pip3: 20.0.2 - C:\Python38\Scripts\pip3.EXE
  Utilities:
    Git: 2.25.1. - /mingw64/bin/git
  Virtualization:
    Docker: 19.03.8 - C:\Program Files\Docker\Docker\resources\bin\docker.EXE
  IDEs:
    VSCode: 1.43.0 - C:\Program Files\Microsoft VS Code\bin\code.CMD
  Languages:
    Bash: 4.4.23 - C:\Program Files\Git\usr\bin\bash.EXE
    Java: 1.8.0_211 - /c/Program Files/Java/jdk1.8.0_211/bin/javac
    Perl: 5.26.2 - C:\Program Files\Git\usr\bin\perl.EXE
    Python: 3.8.2 - /c/Python38/python

Here is the output log from ./compose.sh : compose.log

If you need other info let me know,

I'm a Docker newbie but I'll be glad to participate in this project.

ccarcaci commented 4 years ago

Thank you for these further information.

The project has never been tested on Windows, but, no problem, we can do some debugging. Anyway, I'll try to test this in a Virtual Machine with Windows 7 later.

If you want to do some debugging try to launch the "budtmo/docker-android-x86-10.0" image alone with this command: $ docker run --env DEVICE="Samsung Galaxy S10" -p 5555:5555 -p 6080:6080 --privileged budtmo/docker-android-x86-10.0

Then use adb to connect to the emulator. $ adb connect localhost:5555

Then list the attached devices $ adb device

you should see the following output:

claudio:platform-tools$ adb devices
List of devices attached
localhost:5555  device

If you are able to connect to the running device within the Docker emulator image this means that we should investigate the expo Docker image when running on Windows OS and not the emulator.

Shuunen commented 4 years ago

Here is the result of docker run --name docker_android --env DEVICE="Samsung Galaxy S10" -p 5555:5555 -p 6080:6080 --privileged budtmo/docker-android-x86-10.0 (I gave the instance a name) :

2020-03-22 06:42:49,074 CRIT Supervisor running as root (no user in config file)
2020-03-22 06:42:49,075 INFO supervisord started with pid 6
2020-03-22 06:42:50,078 INFO spawned: 'xvfb' with pid 9
2020-03-22 06:42:50,079 INFO spawned: 'port-forward' with pid 10
2020-03-22 06:42:50,080 INFO spawned: 'novnc' with pid 11
2020-03-22 06:42:50,081 INFO spawned: 'openbox' with pid 12
2020-03-22 06:42:50,082 INFO spawned: 'x11vnc' with pid 13
2020-03-22 06:42:50,083 INFO spawned: 'screen-copy' with pid 14
2020-03-22 06:42:50,084 INFO spawned: 'docker-appium' with pid 15
2020-03-22 06:42:50,085 INFO spawned: 'atd' with pid 16
2020-03-22 06:42:50,086 INFO spawned: 'auto-recording' with pid 17
2020-03-22 06:42:50,098 INFO spawned: 'adb-utils' with pid 20
2020-03-22 06:42:50,105 INFO exited: screen-copy (exit status 0; not expected)
2020-03-22 06:42:50,113 INFO exited: atd (exit status 0; not expected)
2020-03-22 06:42:51,141 INFO success: xvfb entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2020-03-22 06:42:51,141 INFO success: port-forward entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2020-03-22 06:42:51,141 INFO success: novnc entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2020-03-22 06:42:51,141 INFO success: openbox entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2020-03-22 06:42:51,142 INFO success: x11vnc entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2020-03-22 06:42:51,142 INFO spawned: 'screen-copy' with pid 130
2020-03-22 06:42:51,143 INFO success: docker-appium entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2020-03-22 06:42:51,144 INFO spawned: 'atd' with pid 131
2020-03-22 06:42:51,144 INFO success: auto-recording entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2020-03-22 06:42:51,144 INFO success: adb-utils entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2020-03-22 06:42:51,159 INFO exited: atd (exit status 0; not expected)
2020-03-22 06:42:51,160 INFO exited: screen-copy (exit status 0; not expected)
2020-03-22 06:42:51,354 INFO exited: docker-appium (exit status 0; expected)
2020-03-22 06:42:53,357 INFO spawned: 'screen-copy' with pid 152
2020-03-22 06:42:53,358 INFO spawned: 'atd' with pid 153
2020-03-22 06:42:53,360 INFO exited: screen-copy (exit status 0; not expected)
2020-03-22 06:42:53,361 INFO exited: atd (exit status 0; not expected)
2020-03-22 06:42:56,114 INFO exited: auto-recording (exit status 0; expected)
2020-03-22 06:42:57,115 INFO spawned: 'screen-copy' with pid 155
2020-03-22 06:42:57,116 INFO spawned: 'atd' with pid 156
2020-03-22 06:42:57,119 INFO exited: screen-copy (exit status 0; not expected)
2020-03-22 06:42:57,119 INFO exited: atd (exit status 0; not expected)
2020-03-22 06:42:58,120 INFO gave up: screen-copy entered FATAL state, too many start retries too quickly
2020-03-22 06:42:58,121 INFO gave up: atd entered FATAL state, too many start retries too quickly

Then I opened a bash inside the instance : docker exec -it docker_android /bin/bash

And here is what I got :

root@f3a4a7514538:~# adb devices
List of devices attached

root@f3a4a7514538:~# adb connect localhost:5555
Cannot assign requested address

But when you says "You can find adb into platform-tools here" I'm wondering, did you wanted me to execute theses adb commands on my windows host machine ?

ccarcaci commented 4 years ago

But when you says "You can find adb into platform-tools here" I'm wondering, did you wanted me to execute theses adb commands on my windows host machine ?

Yes, indeed. We should verify if the docker-android container is able to receive incoming connections from external adb.

Shuunen commented 4 years ago

hey @ccarcaci, sorry but I had to install the whole android dev stack to deliver a project, and to get the android emulator to work I had to uninstall Hyper-V (to enable vt-d/vt-x) and after that Docker refused to run because it depends on it.

Because I can't investigate anymore without Docker, you may keep or close this issue, it's your call,

If I can I'll come back to try again your project and finally have a portable Android Development environment 😄

ccarcaci commented 4 years ago

Hey @Shuunen , I've tried to investigate how to run the project on Windows 7.

Unfortunately, I got a bunch of errors because my Windows 7 instance runs inside a VM that has not fully Hyper-V support. I have not gone deep further.

I should test (and provide a script compatible with Windows) on a Windows machine to validate its compatibility.

This issue will be closed, but feel free to return to add some further comments.

Thank you