平台

Android builds

Build an Expo app as a release APK that trusts danwo's proxy, and reuse it until its sources change.

本页还没有中文版,下面是英文原文。

An Android app trusts only the system's certificates unless its build says otherwise. danwo's proxy has its own certificate, created for each run. danwo build-android builds your Expo app so it trusts it.

Build it

npx @danwo/cli build-android app

app is the folder of your Expo project. The same command builds a Gradle project (Native Android apps) or a Flutter app (Flutter); it tells them apart by what the folder holds. For an Expo app, danwo:

  1. runs expo prebuild;
  2. adds a network security config that also trusts user-installed certificates, where danwo puts each run's;
  3. runs gradlew assembleRelease with DANWO=1, using Android Studio's JDK when JAVA_HOME is unset.

The JavaScript is bundled into the APK, so no Metro server runs during tests. Gradle runs with --no-daemon and compiles Kotlin in its own process, so the build leaves no Gradle or Kotlin daemon running.

Reuse it

The APK is kept under <project>/.danwo/builds/, keyed by a hash of the app's sources. An unchanged app isn't built again. Force a rebuild with --force.

Workers share one build. On a cold run the first worker builds the app, and the others wait for it and then install the same APK.

Build it from the config

buildAndroid from @danwo/mobile does the same inside your environment, so a test run always has a current build:

build.ts
import { buildAndroid } from "@danwo/mobile"

export async function currentApk(): Promise<string> {
  const build = await buildAndroid({ project: "app" })

  return build.apk
}

This build trusts user-installed certificates. Use it only for testing; ship your store builds without it.

Next

本页内容

在每个 Pull Request 上运行

每个 Pull Request 一个 GitHub Check 和一条评论,并附上完整的运行记录。

配置 CI