{"id":51393990,"url":"https://github.com/hoklims/cargo-quad-apk","last_synced_at":"2026-07-04T01:34:30.808Z","repository":{"id":367364684,"uuid":"1280465762","full_name":"hoklims/cargo-quad-apk","owner":"hoklims","description":"Rust 2024-compatible fork of cargo-quad-apk: build Android APKs for miniquad/macroquad projects (cargo 0.95 / edition 2024).","archived":false,"fork":false,"pushed_at":"2026-06-25T16:48:09.000Z","size":70,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-07-04T01:34:28.929Z","etag":null,"topics":["android","apk","cargo-subcommand","macroquad","miniquad","rust","rust-2024"],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/hoklims.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-25T15:59:26.000Z","updated_at":"2026-06-25T16:48:13.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/hoklims/cargo-quad-apk","commit_stats":null,"previous_names":["hoklims/cargo-quad-apk"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hoklims/cargo-quad-apk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoklims%2Fcargo-quad-apk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoklims%2Fcargo-quad-apk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoklims%2Fcargo-quad-apk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoklims%2Fcargo-quad-apk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hoklims","download_url":"https://codeload.github.com/hoklims/cargo-quad-apk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoklims%2Fcargo-quad-apk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35107463,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-03T02:00:05.635Z","response_time":110,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["android","apk","cargo-subcommand","macroquad","miniquad","rust","rust-2024"],"created_at":"2026-07-04T01:34:27.747Z","updated_at":"2026-07-04T01:34:30.803Z","avatar_url":"https://github.com/hoklims.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cargo-quad-apk (Rust 2024 compatible fork)\n\n[![CI](https://github.com/hoklims/cargo-quad-apk/actions/workflows/ci.yml/badge.svg)](https://github.com/hoklims/cargo-quad-apk/actions/workflows/ci.yml)\n[![Android APK](https://github.com/hoklims/cargo-quad-apk/actions/workflows/android-apk.yml/badge.svg)](https://github.com/hoklims/cargo-quad-apk/actions/workflows/android-apk.yml)\n\nA maintained, **Rust 2024 edition–compatible** fork of\n[`not-fl3/cargo-quad-apk`](https://github.com/not-fl3/cargo-quad-apk) — the cargo\nsubcommand that builds Android `.apk` packages for\n[miniquad](https://github.com/not-fl3/miniquad) / [macroquad](https://github.com/not-fl3/macroquad)\nprojects.\n\nIt is itself a fork of the old `android-rs-glue` crate, specialized for building\nminiquad-based projects.\n\n```sh\ncargo quad-apk build --example my_game\n```\n\n---\n\n## Why this fork exists\n\n`cargo-quad-apk` does not call the `cargo` binary — it **links the `cargo` crate\nas a library** and drives the build through cargo's internal API (a custom\n`Executor` rewrites every `rustc` invocation to produce a `cdylib`, injects the\nAndroid linker flags and the miniquad JNI glue code, then assembles the APK with\nthe NDK/SDK tools).\n\nThat internal API **is not stable**. The `cargo` team makes no guarantees about\nit, and it changes every Rust release. As a result the upstream tool bit-rots:\n\n- On a recent toolchain it **panics at startup** —\n  `command 'logcat' alias 'r' is duplicated` — because two subcommands declared\n  the same clap alias, which newer `clap` rejects with a debug assertion.\n- It is still pinned to `edition = \"2018\"`.\n\nThis fork fixes those issues and, crucially, **documents and enforces the version\ncoupling** that makes the tool buildable at all (see below).\n\n## The one rule: `cargo` library version must match your Rust toolchain\n\nThe published `cargo` **library** crate is versioned `0.N`, and version `0.N`\nmatches Rust **`1.N`**:\n\n| `cargo` crate | Rust toolchain |\n| ------------- | -------------- |\n| `0.95.x`      | `1.95`         |\n| `0.96.x`      | `1.96`         |\n| `0.97.x`      | `1.97`         |\n\nThis repository pins both sides so they can never drift apart:\n\n```toml\n# Cargo.toml\ncargo = \"=0.95.0\"\n```\n\n```toml\n# rust-toolchain.toml\n[toolchain]\nchannel = \"1.95.0\"\n```\n\n**To move to a newer Rust:** bump *both* numbers together (e.g. `=0.96.0` +\n`1.96.0`), then run `cargo build` and fix any internal-API drift the compiler\nreports. Bumping only one side will fail to compile.\n\n\u003e The embedded `cargo` library understands every edition rustc does (including\n\u003e 2024), so once installed this tool builds miniquad/macroquad projects of **any**\n\u003e edition — your game crate does not have to be edition 2024.\n\n## Prerequisites\n\n- **Rust 1.95** (the repo's `rust-toolchain.toml` selects it automatically when\n  you build inside the repo).\n- **Android SDK** with `build-tools` and `platform-tools`, plus the matching\n  `platforms/android-\u003cversion\u003e/android.jar`.\n- **Android NDK** (r23+; the tool uses `llvm-ar` / `llvm-readelf` / unified\n  `ld`).\n- A **JDK** (`javac`, `keytool`) on `PATH` or via `JAVA_HOME`.\n- `zip` on `PATH`.\n\nEnvironment variables the tool reads:\n\n| Variable | Purpose |\n| -------- | ------- |\n| `NDK_HOME` | Path to the Android NDK (required) |\n| `ANDROID_SDK_HOME` or `ANDROID_HOME` | Path to the Android SDK (required) |\n| `JAVA_HOME` | Used to locate `javac` / `keytool` if not on `PATH` |\n\n## Installation\n\n### Recommended — build inside the repo (honors `rust-toolchain.toml`)\n\n```sh\ngit clone https://github.com/hoklims/cargo-quad-apk\ncd cargo-quad-apk\ncargo install --path .\n```\n\n### With `cargo install --git`\n\n`cargo install --git` builds in a temporary directory and uses your **active**\ntoolchain, which must match the pinned `cargo` crate. Pin it explicitly:\n\n```sh\ncargo +1.95.0 install --git https://github.com/hoklims/cargo-quad-apk\n```\n\n(If `1.95.0` is not installed: `rustup toolchain install 1.95.0`.)\n\n## Usage\n\n```sh\ncargo quad-apk build [--release] [--example \u003cname\u003e] [--nosign] [--nostrip]\ncargo quad-apk run   [--example \u003cname\u003e]    # build, install, and launch on a device\ncargo quad-apk install\ncargo quad-apk logcat\n```\n\n`build` produces APKs under\n`target/android-artifacts/\u003cdebug|release\u003e/apk/`.\n\n## Supported `[package.metadata.android]` entries\n\n```toml\n# The target Android API level. \"android_version\" is the compile SDK version.\n# Defaults to 36. (target_sdk_version defaults to android_version;\n# min_sdk_version defaults to 18 — the minimum supported by rustc.)\nandroid_version = 29\ntarget_sdk_version = 29\nmin_sdk_version = 26\n\n# Targets to build for.\n# Defaults to: armv7-linux-androideabi, aarch64-linux-android, i686-linux-android\nbuild_targets = [ \"armv7-linux-androideabi\", \"aarch64-linux-android\", \"i686-linux-android\", \"x86_64-linux-android\" ]\n\n# The Java package name. Hyphens are converted to underscores.\n# Defaults to rust.\u003ctarget_name\u003e for binaries, rust.\u003cpackage_name\u003e.example.\u003ctarget_name\u003e for examples.\npackage_name = \"rust.cargo.apk.advanced\"\n\n# User-facing app name. Defaults to the target name.\nlabel = \"My Android App\"\n\n# Internal version number (integer). Defaults to 1.\nversion_code = 2\n\n# User-facing version string. Defaults to the cargo package version.\nversion_name = \"2.0\"\n\n# Path to a resources folder (optional).\nres = \"path/to/res_folder\"\n\n# Launcher icon (optional), e.g. \"@mipmap/ic_launcher\".\nicon = \"@mipmap/ic_launcher\"\n\n# Path to an assets folder (optional).\nassets = \"path/to/assets_folder\"\n\n# Run full-screen. Defaults to false.\nfullscreen = false\n\n# Max supported OpenGL ES version claimed by the manifest. Defaults to 2.0.\nopengles_version_major = 3\nopengles_version_minor = 2\n\n# Extra XML attributes on the \u003capplication\u003e tag.\n[package.metadata.android.application_attributes]\n\"android:debuggable\" = \"true\"\n\"android:hardwareAccelerated\" = \"true\"\n\n# Extra XML attributes on the \u003cactivity\u003e tag.\n[package.metadata.android.activity_attributes]\n\"android:screenOrientation\" = \"unspecified\"\n\n# uses-feature elements (keys: name, required, version).\n[[package.metadata.android.feature]]\nname = \"android.hardware.vulkan.level\"\nversion = \"1\"\nrequired = false\n\n# uses-permission elements.\n[[package.metadata.android.permission]]\nname = \"android.permission.CAMERA\"\n\n# service elements.\n[[package.metadata.android.service]]\nname = \".ForegroundService\"\nforeground_service_type = \"remoteMessaging\"\nexported = false\n```\n\n## Build tool environment variables\n\ncargo-quad-apk exposes the NDK C/C++ toolchain to build scripts (so crates using\nthe `cc` / `cmake` crates build correctly):\n\n- `CC` / `CXX` — NDK `clang` / `clang++` wrappers for the target \u0026 platform.\n- `AR` — NDK `llvm-ar`.\n- `CXXSTDLIB` — `c++` (NDK's full C++ standard library).\n- `CMAKE_TOOLCHAIN_FILE`, `CMAKE_GENERATOR`, `CMAKE_MAKE_PROGRAM` — generated CMake\n  toolchain pointing at the NDK.\n\n## Building with Docker\n\nUpstream publishes a Docker image for reproducible builds:\n\n```sh\ndocker run --rm -v \"$(pwd)\":/root/src -w /root/src notfl3/cargo-apk \\\n  cargo quad-apk build --example quad\n```\n\n## Validation\n\nThis repo proves the full pipeline works, it does not just claim it:\n\n- **`test-project/`** is a minimal miniquad app written in **edition 2024**.\n- The **Android APK** workflow (`.github/workflows/android-apk.yml`) builds it into\n  a real, signed `.apk` on every push — on a clean Ubuntu runner, with NDK r25 and\n  the `aarch64-linux-android` target — then **uploads the APK as a downloadable\n  artifact**. Grab it from the latest green run on the\n  [Actions tab](https://github.com/hoklims/cargo-quad-apk/actions/workflows/android-apk.yml)\n  (\"quad-android-smoke-apk\").\n- The **CI** workflow builds + tests the tool and checks formatting on Linux and\n  Windows.\n\n\u003e Scope: CI builds a debug APK for one ABI; it does not install or run it on a\n\u003e device/emulator. Building the edition-2024 example end-to-end is what verifies\n\u003e the JNI glue is injected in an edition-2024-safe way.\n\n### Validating locally\n\nYou need the Android SDK + NDK (r25 recommended), a JDK, `zip` on `PATH`, and the\nRust target:\n\n```sh\nrustup target add aarch64-linux-android\nexport NDK_HOME=/path/to/android-sdk/ndk/25.2.9519653\nexport ANDROID_HOME=/path/to/android-sdk\ncargo install --path .\ncd test-project\ncargo quad-apk build          # -\u003e target/android-artifacts/debug/apk/*.apk\n```\n\n(On Windows the same applies; ensure a `zip` executable is on `PATH`.)\n\n## Relationship to upstream \u0026 license\n\nThis is a compatibility fork; all original authorship is preserved (see\n`Cargo.toml`). Dual-licensed under **MIT OR Apache-2.0** — see\n[`LICENSE-MIT`](LICENSE-MIT) and [`LICENSE-APACHE`](LICENSE-APACHE). (Upstream\nshipped an Apache-2.0 license file while declaring `MIT` in `Cargo.toml`; this\nfork resolves that by offering both, the Rust ecosystem norm.)\n\nSee [`CHANGELOG.md`](CHANGELOG.md) for the exact set of changes relative to\n`not-fl3/cargo-quad-apk`.\n\nCredit to Pierre Krieger, Philip Alldredge and Fedor Logachev (not-fl3) for the\noriginal work.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhoklims%2Fcargo-quad-apk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhoklims%2Fcargo-quad-apk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhoklims%2Fcargo-quad-apk/lists"}