Insomniac
Insomniac copied to clipboard
Add feature to log in
I use your code within a simulated android environment in docker. It could up automatically till the point of log in in the app. For CD purpose this feature will be nice to automatic log in(also handle multiple accounts in the app make sense). If you want I could create the Dockerfile for this feature.
What simulated android environment do you have?
What simulated android environment do you have?
You can use different devices and different os versions. I used this docker image as a base image: https://github.com/budtmo/docker-android. It worked like a charm on an older laptop with 4 cores and 8gb ram with two android container (for two accounts).
Thanks for this resource, it looks awesome! I will give it a try.
@alexal1 What do you think about the idea to deploy this framework in docker with a ready to go android setup?
Thanks for this resource, it looks awesome! I will give it a try.
Do give it a try?
I just tried it and it looks like it is working but the emulator doesn't have Google Play Store... What did you use to download Instagram app? Also, do you have Discord? I am not sure if we should keep talking about this here as it not the main issue.
@mv-debug Could Could you give more information on how to make it work please?
@markbookk thanks for trying it, when its posible i will give a try! Sharing content here is a good way to everyone learn about it 👍
I just tried it and it looks like it is working but the emulator doesn't have Google Play Store... What did you use to download Instagram app? Also, do you have Discord? I am not sure if we should keep talking about this here as it not the main issue.
You could use adb to install an app. And you could download apps on some free platforms. Is it allowed to name it here, I will try: https://www.apkmirror.com/apk/instagram/instagram-instagram/instagram-instagram-139-0-0-33-121-release/instagram-139-0-0-33-121-12-android-apk-download/
It is important to use the x86 architecture - if you use docker on amd64 or x86 processor.
I do not have discord, sorry.
@mv-debug Could Could you give more information on how to make it work please?
@markbookk thanks for trying it, when its posible i will give a try! Sharing content here is a good way to everyone learn about it +1
I could write down the steps here - if it okay for you.
How to:
- install docker and adb (https://docs.docker.com/get-docker/, https://developer.android.com/studio/command-line/adb)
- Run a container with e.g. docker run --privileged -d -p 6080:6080 -p 5554:5554 -p 5555:5555 -e DEVICE="Samsung Galaxy S6" --name android-container budtmo/docker-android-x86-8.1
- Download Instagram (https://www.apkmirror.com/apk/instagram/instagram-instagram/instagram-instagram-139-0-0-33-121-release/instagram-139-0-0-33-121-12-android-apk-download/) app and install via adb install path_to_apk
- Log in manually and also search one time to access the permission pop up. These step have to be done manually and these have to be automated - if implemented the whole execution of the remote handling could be done in a cloud and in continuous deployment
I could also provide a video if you are interested.
I just tried it and it looks like it is working but the emulator doesn't have Google Play Store... What did you use to download Instagram app? Also, do you have Discord? I am not sure if we should keep talking about this here as it not the main issue.
You could use adb to install an app. And you could download apps on some free platforms. Is it allowed to name it here, I will try: https://www.apkmirror.com/apk/instagram/instagram-instagram/instagram-instagram-139-0-0-33-121-release/instagram-139-0-0-33-121-12-android-apk-download/
It is important to use the x86 architecture - if you use docker on amd64 or x86 processor.
I do not have discord, sorry.
Cool, thanks! I will give it a try and let you know if it worked. I totally forgot I could add the apps via adb.
@mv-debug thanks, What OS are you using to run it?
@mv-debug thanks, What OS are you using to run it?
Hey, I use linux only for development - it is the better platform. But it should also work on windows. If you have got a problem with mac os or windows see: https://github.com/budtmo/docker-android#quick-start
@mv-debug thanks for the help! I used adb install and it worked.
@future2back I also use Linux (Ubuntu) and I can also vouch that it works good.
@mv-debug thanks for the help! I used adb install and it worked.
@future2back I also use Linux (Ubuntu) and I can also vouch that it works good.
I tested it also on a ubuntu machine with 16 cores, with that setup you can run multiple instances of the android simulation (I only test 4 at once). It works like a charm. But it will be nice to implement the login feature.
@mv-debug Nice! Do you use cloud or local hosting?
@mv-debug Nice! Do you use cloud or local hosting?
I tried in a cloud, but you have got manual steps for setup the environment. At the moment I have got a gitlab-runner on my local machine and let it run every hour. Works like charm.
@mv-debug thanks, i will try it here on ubuntu and let you know
I think I am going to write an script to setup the environment with uiautomator2.
How to:
1. install docker and adb (**https://docs.docker.com/get-docker/**, **https://developer.android.com/studio/command-line/adb**) 2. Run a container with e.g. **docker run --privileged -d -p 6080:6080 -p 5554:5554 -p 5555:5555 -e DEVICE="Samsung Galaxy S6" --name android-container budtmo/docker-android-x86-8.1** 3. Download Instagram (**https://www.apkmirror.com/apk/instagram/instagram-instagram/instagram-instagram-139-0-0-33-121-release/instagram-139-0-0-33-121-12-android-apk-download/**) app and install via **adb install path_to_apk** 4. Log in manually and also search one time to access the permission pop up. These step have to be done manually and these have to be automated - if implemented the whole execution of the remote handling could be done in a cloud and in continuous deployment
I could also provide a video if you are interested.
Hello @mv-debug and @markbookk after installing docker (step 1) and added my user to docker group , followed step 2 , after acessing http://myip:6080 i can access it and see a page that has a whale Android Docker, could you describe the steps i should follow to make it works? I m new on Docker, i m sorry!
Thanks a lot.
How to:
1. install docker and adb (**https://docs.docker.com/get-docker/**, **https://developer.android.com/studio/command-line/adb**) 2. Run a container with e.g. **docker run --privileged -d -p 6080:6080 -p 5554:5554 -p 5555:5555 -e DEVICE="Samsung Galaxy S6" --name android-container budtmo/docker-android-x86-8.1** 3. Download Instagram (**https://www.apkmirror.com/apk/instagram/instagram-instagram/instagram-instagram-139-0-0-33-121-release/instagram-139-0-0-33-121-12-android-apk-download/**) app and install via **adb install path_to_apk** 4. Log in manually and also search one time to access the permission pop up. These step have to be done manually and these have to be automated - if implemented the whole execution of the remote handling could be done in a cloud and in continuous deployment
I could also provide a video if you are interested.
Hello @mv-debug and @markbookk after installing docker (step 1) and added my user to docker group , followed step 2 , after acessing http://myip:6080 i can access it and see a page that has a whale Android Docker, could you describe the steps i should follow to make it works? I m new on Docker, i m sorry!
Thanks a lot.
Try in a console adb devices and check if you see something like this emulator-5554. If yes, you could install the downloaded app via adb install path_to_apk. The use the browser to log in. That's all.
How to:
1. install docker and adb (**https://docs.docker.com/get-docker/**, **https://developer.android.com/studio/command-line/adb**) 2. Run a container with e.g. **docker run --privileged -d -p 6080:6080 -p 5554:5554 -p 5555:5555 -e DEVICE="Samsung Galaxy S6" --name android-container budtmo/docker-android-x86-8.1** 3. Download Instagram (**https://www.apkmirror.com/apk/instagram/instagram-instagram/instagram-instagram-139-0-0-33-121-release/instagram-139-0-0-33-121-12-android-apk-download/**) app and install via **adb install path_to_apk** 4. Log in manually and also search one time to access the permission pop up. These step have to be done manually and these have to be automated - if implemented the whole execution of the remote handling could be done in a cloud and in continuous deployment
I could also provide a video if you are interested.
Hello @mv-debug and @markbookk after installing docker (step 1) and added my user to docker group , followed step 2 , after acessing http://myip:6080 i can access it and see a page that has a whale Android Docker, could you describe the steps i should follow to make it works? I m new on Docker, i m sorry! Thanks a lot.
Try in a console adb devices and check if you see something like this emulator-5554. If yes, you could install the downloaded app via adb install path_to_apk. The use the browser to log in. That's all.
Hey @mv-debug thanks for replying, there is no emulator listed on my adb, i runned docker with the same line you listed on step 2! Is it ok?
Thanks
@future2back are you using virtualization for the host OS of Docker?
@future2back are you using virtualization for the host OS of Docker?
No, I m using ubuntu on a physical computer to run docker.... I tried rebooting my computer, after it
i had to remove --name android-container
from this line:
docker run --privileged -d -p 6080:6080 -p 5554:5554 -p 5555:5555 -e DEVICE="Samsung Galaxy S6" --name android-container budtmo/docker-android-x86-8.1
so i started docker image with this line:
docker run --privileged -d -p 6080:6080 -p 5554:5554 -p 5555:5555 -e DEVICE="Samsung Galaxy S6" budtmo/docker-android-x86-8.1
is it ok? I m sorry, thanks for for taking your time.
docker run --privileged -d -p 6080:6080 -p 5554:5554 -p 5555:5555 -e DEVICE="Samsung Galaxy S6" --name android-container budtmo/docker-android-x86-8.1
I use this line and it works for me.
Why do you say you had to remove --name android-container
? Any error occurred or anything pops up that you can share?
docker run --privileged -d -p 6080:6080 -p 5554:5554 -p 5555:5555 -e DEVICE="Samsung Galaxy S6" --name android-container budtmo/docker-android-x86-8.1
I use this line and it works for me.
Why do you say you had to remove
--name android-container
? Any error occurred or anything pops up that you can share?
heyy @markbookk i had no problem using this line at first time, as the emulator did not appear in the list of devices i restarted the computer, so, do i have to open it again? then if i try
docker run --privileged -d -p 6080:6080 -p 5554:5554 -p 5555:5555 -e DEVICE="Samsung Galaxy S6" --name android-container budtmo/docker-android-x86-8.1
i get this error message:
docker: Error response from daemon: Conflict. The container name "/android-container" is already in use by container "e8c40ee99723e797c3e36b1cebc3fa330705de25bca47fff153b8a3032eacfd8". You have to remove (or rename) that container to be able to reuse that name.
See 'docker run --help'.
thats why i removed --name android-container
to "reopen" the image. So i could reopen it but still not appear in the list of devices when i use adb devices
That error means that you already have a container running. You can do docker ps -a
to list all containers (not just the ones that are running). More information here: https://docs.docker.com/engine/reference/commandline/ps/
You don't have to create a new docker container every time. You just need to start the container you already created with docker start {name}
or in your case docker start android-container
.
In regards to the device not showing on adb devices
, I am not sure what the problem may be but it doesn't seem to be a problem with the "docker-android" as it works fine for me. I think your docker container isn't fully running, as you said you only see the "whale android docker" page and you are supposed to be seeing the android emulator.
That error means that you already have a container running. You can do
docker ps -a
to list all containers (not just the ones that are running). More information here: https://docs.docker.com/engine/reference/commandline/ps/You don't have to create a new docker container every time. You just need to start the container you already created with
docker start {name}
or in your casedocker start android-container
.In regards to the device not showing on
adb devices
, I am not sure what the problem may be but it doesn't seem to be a problem with the "docker-android" as it works fine for me. I think your docker container isn't fully running, as you said you only see the "whale android docker" page and you are supposed to be seeing the android emulator.
@future2back Do you see an device under localhost:6080? Something like this.
If you Plug in an real device to the pc, do you see this one via adb? Maybe some udev rules cause problems. Try to use the original ubuntu package (sudo apt install adb), within this package the correct udev rules are rolled out..
That error means that you already have a container running. You can do
docker ps -a
to list all containers (not just the ones that are running). More information here: https://docs.docker.com/engine/reference/commandline/ps/You don't have to create a new docker container every time. You just need to start the container you already created with
docker start {name}
or in your casedocker start android-container
.In regards to the device not showing on
adb devices
, I am not sure what the problem may be but it doesn't seem to be a problem with the "docker-android" as it works fine for me. I think your docker container isn't fully running, as you said you only see the "whale android docker" page and you are supposed to be seeing the android emulator.
Thanks for explain me that!
That error means that you already have a container running. You can do
docker ps -a
to list all containers (not just the ones that are running). More information here: https://docs.docker.com/engine/reference/commandline/ps/ You don't have to create a new docker container every time. You just need to start the container you already created withdocker start {name}
or in your casedocker start android-container
. In regards to the device not showing onadb devices
, I am not sure what the problem may be but it doesn't seem to be a problem with the "docker-android" as it works fine for me. I think your docker container isn't fully running, as you said you only see the "whale android docker" page and you are supposed to be seeing the android emulator.@future2back Do you see an device under localhost:6080? Something like this.
If you Plug in an real device to the pc, do you see this one via adb? Maybe some udev rules cause problems. Try to use the original ubuntu package (sudo apt install adb), within this package the correct udev rules are rolled out..
There is no android phone like yours. Thats why i asked if the line on step 2 is correct.
If i right click on it:
Yes i can see device to the pc on using adb.
Any idea? Thanks @markbookk
That error means that you already have a container running. You can do
docker ps -a
to list all containers (not just the ones that are running). More information here: https://docs.docker.com/engine/reference/commandline/ps/ You don't have to create a new docker container every time. You just need to start the container you already created withdocker start {name}
or in your casedocker start android-container
. In regards to the device not showing onadb devices
, I am not sure what the problem may be but it doesn't seem to be a problem with the "docker-android" as it works fine for me. I think your docker container isn't fully running, as you said you only see the "whale android docker" page and you are supposed to be seeing the android emulator.Thanks for explain me that!
That error means that you already have a container running. You can do
docker ps -a
to list all containers (not just the ones that are running). More information here: https://docs.docker.com/engine/reference/commandline/ps/ You don't have to create a new docker container every time. You just need to start the container you already created withdocker start {name}
or in your casedocker start android-container
. In regards to the device not showing onadb devices
, I am not sure what the problem may be but it doesn't seem to be a problem with the "docker-android" as it works fine for me. I think your docker container isn't fully running, as you said you only see the "whale android docker" page and you are supposed to be seeing the android emulator.@future2back Do you see an device under localhost:6080? Something like this.
If you Plug in an real device to the pc, do you see this one via adb? Maybe some udev rules cause problems. Try to use the original ubuntu package (sudo apt install adb), within this package the correct udev rules are rolled out..
There is no android phone like yours. Thats why i asked if the line on step 2 is correct.
If i right click on it:
Yes i can see device to the pc on using adb.
Any idea? Thanks @markbookk
What kind of pc or laptop do you have? Sometime a start of an stopped container end in your situation. But a fresh container looks like my pic. Maybe some virtualization setting are not enabled or you do not have enough power for emulation.