mirror of
https://github.com/budtmo/docker-android.git
synced 2026-04-25 20:25:57 +03:00
[GH-ISSUE #87] Device is unauthorized #69
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/docker-android#69
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @red-avtovo on GitHub (Jul 6, 2018).
Original GitHub issue: https://github.com/budtmo/docker-android/issues/87
Latest emulator doesn't provide debugging option enabled by default, which doesn't allow to run automation on Android 7.x
Operating System:
Debian 9
Docker Image:
butomo1989/docker-android-x86-7.1.1
Docker Version:
18.03.1-ce, build 9ee9f40
Docker Command to start docker-android:
Expected Behavior
Device is authorized or at least asking for authorization, like on android 8.x images
Actual Behavior
@budtmo commented on GitHub (Jul 6, 2018):
I think it is possible to do it manually under Developer Option @red-avtovo , but yes, we need to automate it somehow.
@red-avtovo commented on GitHub (Jul 6, 2018):
I'm digging in it and I really hope, that this is just 1 argument to avd creation or emulator starting
@diemol commented on GitHub (Jul 6, 2018):
I bumped into the same issue some weeks ago, the root cause is because when the emulator is using Google Play Services it assumes that it is a "production build", so no root access is possible.
To install apps and so on, adb uses the common mechanism of private and public keys. And this error pops up when the emulator does not have the public key of the adb server.
The way I fixed it in our project was to do "adb devices" before starting the emulator. This is implicitly starting the adb server and generating the keys before the emulator is started, and when the emulator starts it will have the adb server keys.
That is what needs to be automated in order to have it working.
@red-avtovo commented on GitHub (Jul 6, 2018):
Will try that! Thank @diemol
@red-avtovo commented on GitHub (Jul 9, 2018):
@diemol that would be super easy, but it didn't work. I see the keys, but emulator doesn't know about them.
@red-avtovo commented on GitHub (Jul 9, 2018):
I solved an issue by starting emulator with
-wipe-dataflag.@budtmo commented on GitHub (Jul 9, 2018):
Hi @red-avtovo ,
Could you create a PR for it? It would be great.
@diemol commented on GitHub (Jul 9, 2018):
ah ok, the
adb devicesthing works when the AVD has not been created yet, which is the approach I was using (and I omitted that part).Your solution seems pretty good as well, I didn't think about it :) But I guess that can make the boot process slightly slower?
@red-avtovo commented on GitHub (Jul 9, 2018):
I didn't make a PR yet, because I'm pretty sure, that we need this tweak just for first container run.
After container restart that would be quite annoying to loose all data.
@budtmo commented on GitHub (Jul 10, 2018):
Fixed in release 1.2
@shadow1163 commented on GitHub (Jul 17, 2018):
@butomo1989 @red-avtovo Hi, I can reproduce this issue using image "butomo1989/docker-android-x86-7.1.1" tag 1.2, its image id is "ace02bf9cf03".

Here is docker command
Container logs are here.
Could you help to confirm it, please?
@JoeSSS commented on GitHub (Jul 17, 2018):
I also have the issue but only with playstore image.. tried everything there and rolling back to normal google_apis as I cannot understand what playstore needs..
@JoeSSS commented on GitHub (Jul 17, 2018):
@red-avtovo @butomo1989 can you please reopen the issue? The issue is still there on the playstore image. Tried to fix it in the several ways today but I'm out of ideas, need new sources :))
@red-avtovo commented on GitHub (Jul 17, 2018):
@butomo1989 please open this issue
@JoeSSS @shadow1163 I will try to fix it tomorrow
@JoeSSS commented on GitHub (Jul 17, 2018):
Do you have ideas of what can be done there? Interesting is that:
a) This doesn't happen when you access emulator from the inside of container. It happens only on
adb start-serverfrom outside the containerb) Clicking remember checkbox doesn't really help. After
adb kill-server && adb start-serverit will request the access again.. I thought that it can be related to adbkey from .android and copied it over to local linux machine but it also didn't work@budtmo commented on GitHub (Jul 17, 2018):
Sorry guys @red-avtovo @JoeSSS @shadow1163 , I have a visit until end of next week so I cannot help :(
@red-avtovo commented on GitHub (Jul 17, 2018):
@JoeSSS oh, that happens, because you are not sharing the same Android key with container.
Right after we create the container, we generate new identity and then newly created emulator remembers the key of his creator.
My fix did not imply the case, when you try to access the emulator from outside of container
@JoeSSS commented on GitHub (Jul 17, 2018):
so, you must run tests inside the container? I use it from running Calabash tests and they are outside.
@red-avtovo commented on GitHub (Jul 17, 2018):
Would be good if you will try to use the container as a Grid node. It will proxy all requests through Appium server and eventually execute all commands on container locally
@red-avtovo commented on GitHub (Jul 17, 2018):
@shadow1163 do you try to connect to emulator through exposed port outside of container?
@JoeSSS commented on GitHub (Jul 17, 2018):
I mean, I may be able to workaround it by just including my tests to the container and just run them inside. But I think that this guy will still trigger adb from outside to get acces + I believe that there are situations when people just want to use the emulator from local :)
@JoeSSS commented on GitHub (Jul 17, 2018):
do you think that it is possible to do something here? for example using the same key for both envs if one already exist or defined
@red-avtovo commented on GitHub (Jul 17, 2018):
Then you should run your container with passing directory sharing option:
Your local Android key should already be here:
~/.androidAfter first run of the container, the new emulator instance will be created with your own key and it will solve the issue
@JoeSSS commented on GitHub (Jul 17, 2018):
I will try it tomorrow when I have access to my laptop :) Thanks a lot @red-avtovo
@shadow1163 commented on GitHub (Jul 18, 2018):
@red-avtovo I have tried to connect Android on remote machine, the result is same.
I checked the source code, the cmd string always be not include flag "-wipe-data", does it?
@red-avtovo commented on GitHub (Jul 18, 2018):
I added
-wipe-datafor the first run to initialise emulator with the key, that was generated inside of container.To improve boot time and to let people to keep data inside of emulator storage, container starts from the second time without this flag.
@red-avtovo commented on GitHub (Jul 18, 2018):
@JoeSSS what are your findings? Did you find time to verify proposed solution?
@shadow1163 commented on GitHub (Jul 19, 2018):
The container was run first time, the line app.py line 203 has created file "/root/init", so the line 210 should always return false.
@JoeSSS commented on GitHub (Jul 19, 2018):
@red-avtovo not yet, was busy yesterday. Checking it now
@shadow1163 commented on GitHub (Jul 19, 2018):
I created a PR, please help to review it, thanks very much. @red-avtovo @butomo1989
@JoeSSS commented on GitHub (Jul 19, 2018):
@red-avtovo it works as a charm! I think I will create a README note about this #96 . Thanks a lot.