Skip to content

A docker container that allows the construction of android applications written with rust with all the tools ready to use

Notifications You must be signed in to change notification settings

SergioRibera/docker-rust-android

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust Android

Docker Pulls Docker Image Size with architecture (latest by date/latest semver)

This is a project that tries to package in a small container everything needed and required to build an android gradle project.

Among the components it has are:

  • rust
  • gradle
  • java jdk
  • ndk
  • bundletool
  • buildtools
  • command line tools
  • platform tools

Usage

Command Line:

Note: for more information, consider looking at examples

# Debug
docker run --rm -it -v "$(pwd)/:/src" -w /src sergioribera/rust-android:1.80-sdk-36 assembleDebug -p <android project path>
# Release
docker run --rm -it -v "$(pwd)/:/src" -w /src sergioribera/rust-android:1.80-sdk-36 assembleRelease -p <android project path>

Github Action:

Note: for more information, consider looking at my project kill errors

env:
  APP_NAME: my_application

jobs:
  native_build:
    container: sergioribera/rust-android:180-sdk-33
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: Swatinem/rust-cache@v2
      - name: Load .env file
        uses: xom9ikk/dotenv@v2
      # Start to build
      - name: build apk
        run: gradle assembleRelease -p launchers/mobile/android
      - name: Rename APK
        run: |
          cp launchers/mobile/android/build/outputs/apk/release/android-release.apk ${{ env.APP_NAME }}.apk
      - name: build aab
        run: |
          apk2aab ${{ env.APP_NAME }}.apk ${{ env.APP_NAME }}.aab

Build Examples

Important

You can check the justfile to see how build, generate key and sign apk You can use just run <example name> and build -> sign -> install automatic

Bevy Game

docker run --rm -it -v "$(pwd)/:/src" -w /src sergioribera/rust-android:1.80-sdk-36 assembleDebug -p examples/bevy_game/android

Rust Library

docker run --rm -it -v "$(pwd)/:/src" -w /src sergioribera/rust-android:1.80-sdk-36 assembleDebug -p examples/rust_lib/android

Slint Mobile

docker run --rm -it -v "$(pwd)/:/src" -w /src sergioribera/rust-android:1.80-sdk-36 assembleDebug -p examples/slint

About

A docker container that allows the construction of android applications written with rust with all the tools ready to use

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Contributors 2

  •  
  •