-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build Android tools from source (adb, SDK, Android Studio, etc.) #75603
Comments
One more reason to do this: Nixpkgs' ADB is only available on x86 |
It is currently impossible to accept the android license when the sdk sits in the nix store, and is installed through nixpkgs. So this is probably needed. |
First, note there is an android rebuilds project which aims to provide license unencumbered builds of the android SDK. Also, I've been working on a project (robotnix) to build Android ROMs using nix. As an experiment, I looked into whether it could be leveraged to build the android SDK, with some success: https://github.com/danielfullmer/robotnix/blob/master/sdk/default.nix
Which produces the following files under ./result:
There are a few caveats:
Instead of building the entire SDK, I also looked into building only As far as inclusion in nixpkgs: I think an alternative package for adb/fastboot which doesn't require accepting the SDK license would be most valuable for users. However, I'm not sure such a package would be accepted into nixpkgs if it requires checking out all of AOSP. |
Maybe somebody with more knowledge of the hydra build servers / infra can tell if that would be a problem. But is |
@xaverdh So the cause of the |
If we only want to build tools, there is a friendly build-system for it. https://github.com/nmeum/android-tools |
@musfay that's really awesome, thanks a lot for mentioning it! Seems like the Alpine Linux package maintainer created this and Void Linux is also using and contributing to it. I've drafted #124992 for Nixpkgs but I/we need to figure out how to best fetch the vendored Go modules first (then the rest of the build will hopefully succeed). |
#124992 is now merged, closing :) |
This should be reopened. Currently we're building adb and fastboot from source, but the SDK and Android Studio are still proprietary binaries with license agreements attached to them. |
Indeed. Another issue with a broad scope which becomes hard to close. |
Probably relevant: nix-community/robotnix#107 |
I marked this as stale due to inactivity. → More info |
Keep alive, we got closer with Android cross, and perhaps robotnix can help. |
Is it likely that this will work soon? |
Well the nixos adb module could already use adb built from source (I opened #136040 for that). Everything else will probably take some time. |
|
@zkpgbig android-tools is already packaged from source. |
I just want to build it from source… |
|
We should build as much Android tools as possible from source. The most relevant tool is probably the
adb
(Android Debug Bridge) to communicate with Android phones.Reason
The official builds from Google are distributed under an unfree license (see #53403).
Difficulty
Probably high.
Resources
gitRepo
checkout of ~40GB. Then there are multiple steps involved (without much documentation), but the the build itself was working. The main problem problem is to put all results back together (IntelliJ IDEA, the Android "plugin", and the Android Gradle plugin). And we also don't build IntelliJ IDEA from source so that might be a problem as well.The text was updated successfully, but these errors were encountered: