Giter VIP home page Giter VIP logo

android-sdk-tools's Introduction

Building platform-tools and build-tools for Android, such as aapt aapt2 aidl zipalign adb fastboot ... etc

If you need other tools, please refer to existing tools to add CMake file

Currently only test the aarch64 architecture

I haven't tested other architectures, so I can't guarantee it will work, although I have support for cross-compiling


How to build

Method one, download the release/sdk-tools-source.zip directly to compile, the source code has been patched

# arch [armeabi-v7a, arm64-v8a, x86, x86_64]
python build.py \
    --ndk=/path/to/android-ndk-xxx \
    --abi arm64-v8a
    
# specify the build output directory, default is build
python build.py \
    --ndk=/path/to/android-ndk-xxx \
    --abi arm64-v8a \
    --build build/aarch64
    
# specify the build target, such as aapt2 adb, etc
python build.py \
    --ndk=/path/to/android-ndk-xxx \
    --abi arm64-v8a \
    --build build/aarch64 \
    --target aapt2
    
# there are also some options, execute python build.py --help to see

Method two, start from scratch,git clone the source code, then patch it manually
Why patch it manually? the main reason is the aosp master branch is updated very quickly, so the patch files may be incompatible

# clone the repository
git clone --depth=1 https://github.com/Lzhiyong/sdk-tools

cd sdk-tools

# download the source code default is master branch
python get_source.py

# or you can specify the git tags
# the all available tags https://android.googlesource.com/platform/frameworks/base/+refs
python get_source.py --tags platform-tools-33.0.3

# note that you need a host protoc before compilation for generating cpp files
# host protoc not target platform protoc
# how to get a host protoc
# cd src/protobuf, use host clang or gcc to compile it, you can get a host protoc
# why not use the system's protobuf? mainly the version incompatibility
# if the protobuf version is too new, you may encounter the following error
# error: this file was generated by a newer version of protoc
python build.py \
    --ndk=/path/to/android-ndk-xxx \
    --abi arm64-v8a \
    --build build/aarch64 \
    --protoc=/path/to/protoc
    

android-sdk-tools's People

Contributors

lzhiyong avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.