examples: bazel run that boots a hermetic emulator (demo delta) - #5
Closed
AttilaTheFun wants to merge 1 commit into
Closed
examples: bazel run that boots a hermetic emulator (demo delta)#5AttilaTheFun wants to merge 1 commit into
AttilaTheFun wants to merge 1 commit into
Conversation
Adds //examples/cross_compilation/android_app:run, which installs the example APK on a connected device/emulator and launches it — booting a hermetic emulator first if nothing is connected, so the example runs with nothing preinstalled (no Android Studio, no device). adb comes from @AndroidSDK; the emulator + AOSP system image are downloaded by a dev module extension (emulator.bzl). macOS/arm64 only, to keep the delta small. Demonstrates what zero-setup 'bazel run' support would cost for the example. Claude-Session: https://claude.ai/code/session_01SmG1kqA3qB4WsLGU2xavuJ
Owner
Author
|
Folded into the base Android PR (bazelbuild#1818) — keith's fine with including the hermetic emulator example there. The commit is now part of bazelbuild#1818. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A small demo delta (stacked on the Android PR bazelbuild#1818) showing what it'd take to
make the example runnable with zero external setup — no Android Studio, no device:
It installs the APK on a connected device/emulator and launches it; if nothing is
connected it boots a hermetic emulator first (downloaded emulator + AOSP
system image), so the whole Kotlin → Swift JNI → Swift chain runs from a clean
checkout. Verified end-to-end — booted, installed, launched:
The delta (4 files)
emulator.bzl— a dev module extension that downloads the emulator + a systemimage (the two pieces
@androidsdkdoesn't provide; adb comes from@androidsdk).android.MODULE.bazel—use_extension+use_repofor those two repos.run.sh+ ash_binary(name = "run")— boot-if-needed, install, launch.Caveats (why it's a separate PR, not folded into bazelbuild#1818)
to keep the delta small. A real version would
select()per host OS/arch.is still covered by
app_build_test.bazel run.Mostly meant to show the shape/cost. Happy to fold it into bazelbuild#1818, generalize it
across platforms, or leave the example build-only — your call.