{"id":13604215,"url":"https://github.com/lzhiyong/android-sdk-tools","last_synced_at":"2025-04-11T23:31:56.747Z","repository":{"id":38405923,"uuid":"122611158","full_name":"lzhiyong/android-sdk-tools","owner":"lzhiyong","description":"building android-sdk tools  for Android","archived":false,"fork":false,"pushed_at":"2024-11-22T05:52:36.000Z","size":495,"stargazers_count":388,"open_issues_count":10,"forks_count":66,"subscribers_count":16,"default_branch":"master","last_synced_at":"2024-11-22T06:27:20.744Z","etag":null,"topics":["build-tools","platform-tools","sdk-tools","termux"],"latest_commit_sha":null,"homepage":"","language":"CMake","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lzhiyong.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-23T11:08:40.000Z","updated_at":"2024-11-22T05:52:39.000Z","dependencies_parsed_at":"2024-01-16T23:29:27.264Z","dependency_job_id":"46988cb6-a39a-48e5-afc7-0f96c42f5d2c","html_url":"https://github.com/lzhiyong/android-sdk-tools","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lzhiyong%2Fandroid-sdk-tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lzhiyong%2Fandroid-sdk-tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lzhiyong%2Fandroid-sdk-tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lzhiyong%2Fandroid-sdk-tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lzhiyong","download_url":"https://codeload.github.com/lzhiyong/android-sdk-tools/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248495039,"owners_count":21113554,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["build-tools","platform-tools","sdk-tools","termux"],"created_at":"2024-08-01T19:00:41.773Z","updated_at":"2025-04-11T23:31:55.931Z","avatar_url":"https://github.com/lzhiyong.png","language":"CMake","funding_links":[],"categories":["CMake"],"sub_categories":[],"readme":"Building platform-tools and build-tools for Android, such as `aapt aapt2 aidl zipalign adb fastboot` ... etc.\n\nIf you need other tools, please refer to existing tools to add CMake file.\n\nCurrently, only aarch64 has been tested, and it is not guaranteed to work for other architectures.\n\nIn order to save storage and bandwidth, I have removed all submodules and no longer provide source code compressed packages.\n\nI believe that as long as you have the C/C++ and CMake foundation, it can be easily solved by referring to the patch files.\n\n **** \n \n### How to build\nFirst, we need to use `get_source.py` to clone the source code of all repositories.\n\nPlease note that patch files only apply to specific branches or tags, so we may need to patch manually.\n\n```bash\n# default is master branch\npython get_source.py\n\n# specific branches or tags\npython get_source.py --tags platform-tools-35.0.2\n\n# or tags xxx\n# see available tags https://android.googlesource.com/platform/frameworks/base/+refs\npython get_source.py --tags xxx\n\n```\n\n **** \n\nSecond, we need to build `protobuf` for the host OS which will be used to generate the required sources.\n\n```bash\n# protobuf source directory\ncd src/protobuf \u0026\u0026 mkdir build \u0026\u0026 cd build\n\n# skip the googletest\ncmake -GNinja -Dprotobuf_BUILD_TESTS=OFF ..\n\n# building the protoc-xxx executable file\nninja -j$(nproc --all)\n\n```\n\n **** \n \nFinally, we can use the `NDK` to start building the Android SDK Tools.\n\nPlease note that it is only applicable to Android ndk for compilation, not applicable to other Linux distributions.\n\n```bash\n# abi [arm64-v8a, armeabi-v7a, x86, x86_64]\n# use the protoc-xxx we compiled before\n# note the protoc requires absolute path\npython build.py \\\n    --ndk=/path/to/android-ndk-xxx \\\n    --abi=arm64-v8a \\\n    --build=build/aarch64 \\\n    --protoc=/path/to/protoc-xxx\n    \n# I think you should build each target separately for better error resolution\n# like appt2 adb fastboot...etc\npython build.py \\\n    --ndk=/path/to/android-ndk-xxx \\\n    --abi=arm64-v8a \\\n    --build=build/aarch64 \\\n    --protoc=/path/to/protoc-xxx \\\n    --target=aapt2\n\n# for other options, please execute\npython build.py --help\n\n```\n\n **** \n \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flzhiyong%2Fandroid-sdk-tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flzhiyong%2Fandroid-sdk-tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flzhiyong%2Fandroid-sdk-tools/lists"}