You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+24-13Lines changed: 24 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,21 @@
1
1
# AndroidRemoteBuildWithDocker
2
2
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.
8
19
9
20
## Server configuration
10
21
<details><summary>click to expand</summary>
@@ -49,9 +60,7 @@ For android you can now just copy the mainframer folder and rename it `.mainfram
49
60
50
61
### build with Android Studio
51
62
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.
55
64
56
65
3. click **Run → Edit Configuration → +**.
57
66
@@ -65,29 +74,31 @@ For android you can now just copy the mainframer folder and rename it `.mainfram
65
74
66
75
8. in **Before Launch**, click **+**, add **Run External Tool**, input a new name,like `remote assembleDebug`.
67
76
68
-
69
77
9. in **Program**, input `bash`.
70
78
71
79
10. in **Parameters** input `mainframer.sh ./gradlew :app:assembleDebug -Pandroid.enableBuildCache=true`
72
80
73
-
11. in **Working directory** , input `$ProjectFileDir$`.
81
+
11.The last step, in **Working directory** , input `$ProjectFileDir$`.
74
82
75
83
76
84
</details>
77
85
78
86
## In addition
79
87
80
88
**How to install other sdk?**
89
+
81
90
Modify Dockerfile to rebuild. Or follow these steps:
82
91
83
92
1. start your docker.
84
93
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:
0 commit comments