Skip to content

Commit 3c80116

Browse files
author
bruce
committed
chore:README
1 parent 3d824cc commit 3c80116

1 file changed

Lines changed: 24 additions & 13 deletions

File tree

README.md

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
11
# AndroidRemoteBuildWithDocker
22

3-
If you build Android project on MacBook or other laptops, you must think your computer performance is not enough. Your laptop battery is not enough as well. And you must spend a lot time on waiting it.
4-
So you may want a powerful and portable workstation. It is impossible. But you can build on remote desktop.
5-
The trouble on me as well but I fixed it. I used to take a remote-build with [Mainframer](https://github.com/buildfoundation/mainframer) on my powerful desktop.
6-
It is a problem that Mainframer configuring with Android will spend lost time. In case of building with a cloud service or new desktop, tremendous steps of configuration make me feel tired. Whereas a virtualization technology , such as `Docker` and `Kubernetes`, which I've used in everywhere is very efficient and easy in backup.
7-
In this repo, I make a docker image for a **builder server** that contains Android environment and [Mainframer](https://github.com/buildfoundation/mainframer). You can deploy a google cloud or amazon cloud server for your remote and powerful building. Furthermore, you can run on your desktop in case you have a powerful/high-performance PC with your laptop under one LAN. It works on not only **terminal** but also **Android Studio**.
3+
If you build large Android project on MacBook or other laptops, you must think your computer performance is not enough. Your laptop battery is not enough as well. And you must spend a lot time on waiting it.
4+
So you may want a powerful and portable workstation. It is impossible but you can build on remote desktop.
5+
The trouble on me as well but I fixed it. I used to establish a remote-builder on my powerful desktop. I control the remote-builder by not only terminal but also Android studio.
6+
A problem is that remote-builder configuring with Android will spend lots time. In building it on a cloud service or new desktop, tremendous steps of configuration make me tired. So I made this repo integrate with a couple of technologies: Docker and [Mainframer](https://github.com/buildfoundation/mainframer).
7+
8+
The Mainframer works for remote building. Its official explain:
9+
> A tool that executes a command on a remote machine while syncing files back and forth. The process is known as remote execution (in general) and remote build (in particular cases).
10+
> It works via pushing files to the remote machine, executing the command there and pulling results to the local machine.
11+
12+
And I have to tell you that it work not only temrinal but also Android studio.
13+
14+
Before I said that remote-builder configuring with Android will spend lots time but we have virtualization technology, such as `Docker` and `Kubernetes`, which I've used in everywhere is high-performance and easy to use and backup.
15+
***In this repo, I make a docker image that contains Android environment and [Mainframer](https://github.com/buildfoundation/mainframer)***.
16+
You can run it on your desktop in case you have a powerful/high-performance desktop. It is not required that the desktop and your laptop **under one LAN**. In case the desktop you can connect from anywhere, it can be set the docker image. Furthermore, you can put the docker image on a cloud service, such as, google or amazon cloud server, for your remote and powerful building. Cloud services are elastic in performance and price. Besides, you may think cloud server is high-latency. I have to explain that latency won't effect your building experience because mainframer does not to communitcate your laptop many times in a building process. Even copying files only in before and after buiding build. And the full-file-copy task only once.
17+
18+
To sum up, I explained that the repo works for remote-building. After you establish a remote-builder, you can bring you laptop to coffee shop, grass and sunshine without electric charging.
819

920
## Server configuration
1021
<details><summary>click to expand</summary>
@@ -49,9 +60,7 @@ For android you can now just copy the mainframer folder and rename it `.mainfram
4960

5061
### build with Android Studio
5162

52-
1. open Android Studio, then do these steps:
53-
54-
2. use Android studio to open your project.
63+
1. open Android Studio to open your project.
5564

5665
3. click **Run → Edit Configuration → +**.
5766

@@ -65,29 +74,31 @@ For android you can now just copy the mainframer folder and rename it `.mainfram
6574

6675
8. in **Before Launch**, click **+**, add **Run External Tool**, input a new name,like `remote assembleDebug`.
6776

68-
6977
9. in **Program**, input `bash`.
7078

7179
10. in **Parameters** input `mainframer.sh ./gradlew :app:assembleDebug -Pandroid.enableBuildCache=true`
7280

73-
11. in **Working directory** , input `$ProjectFileDir$`.
81+
11. The last step, in **Working directory** , input `$ProjectFileDir$`.
7482

7583

7684
</details>
7785

7886
## In addition
7987

8088
**How to install other sdk?**
89+
8190
Modify Dockerfile to rebuild. Or follow these steps:
8291

8392
1. start your docker.
8493
2. run `ssh remote_builder` to enter your docker container. Or use docker command to enter it.
85-
3. by the time you entered the bash on your docker container, run `/sdk/tools/bin/sdkmanager--install "ndk;21.0.6113669" --channel=3`.
94+
3. by the time you entered the bash on your docker container, run:
95+
96+
`/sdk/tools/bin/sdkmanager--install "ndk;21.0.6113669" --channel=3`.
8697

8798
**Mainframer also can build other kind of project**
8899
You can fork this project to edit `Dockerfile` to make it work for your project.
89100

90101

91102

92-
### Other features of Mainframer:
93-
[mainframer/v2.1.0 doc](https://github.com/buildfoundation/mainframer/tree/v2.1.0/samples/gradle-android)
103+
**More features of Mainframer:**
104+
[mainframer/v2.1.0 doc](https://github.com/buildfoundation/mainframer/tree/v2.1.0/samples/gradle-android)

0 commit comments

Comments
 (0)