Repository navigation
Commit 1d25c1c
committed
dist-apk: a NativeActivity that runs to completion on both real rows
`tests/apk-consumer/src/main.cpp` now defines `ANativeActivity_onCreate`
under `__ANDROID__`, exported and linked against `libandroid.so`/
`liblog.so` (`[target.'cfg(env = "android")'.runtime] libraries =
["android", "log"]`): it writes the fixture's marker through
`std::puts` (redirected to logcat by `adb-run`'s own
`log.redirect-stdio`) and, unconditionally, through
`__android_log_print`, then calls `ANativeActivity_finish`. `int main`
keeps serving the host row from the same translation unit.
Run end to end (2026-09-12, mcpp PR #624 head, `mcpp run --format apk
--target <triple>`) against two real rows:
x86_64-linux-android, xim:android-emulator@37.1.11 +
xim:android-system-image@24-default-x86_64, KVM-accelerated, booted
through a two-symlink ANDROID_SDK_ROOT (emulator/, platform-tools/ as
siblings -- the emulator SIGSEGVs otherwise, see the android-emulator
fix in the index repository): exit 0, logcat carries
"I apk-consumer: 1-2-3".
aarch64-linux-android, a physical arm64-v8a phone over adb (a second
device this session found attached beside the emulator): exit 0,
same marker, `log.redirect-stdio` itself refused by the device
("Failed to set property") -- which is exactly the case
`__android_log_print` covers. Verified installed with `pm list
packages`, then uninstalled to leave the phone clean.
Both runs surfaced a real adb-run defect, fixed in the index
repository (xim-pkgindex, pkgs/a/android-platform-tools.lua,
37.0.1-3): `am start -W` never returns for an activity that finishes
from `onCreate` (two independent invocations still alive after 691s
and 354s, killed by hand), and `finish()` ends the activity, not the
process, so a `pidof`-only wait loop never ends either. adb-run now
starts without `-W` and waits for `dumpsys activity activities` to
drop the record in addition to `pidof`, then force-stops the app.
`.github/workflows/ci.yml`'s dist-apk step still asserts packaging
only (build + pack + aapt2/apksigner/jar checks) -- this runner has no
emulator and no device, so a `run` step here could only ever report
"no device/emulator found", never the marker. Said explicitly in the
step's own comment now, rather than left implicit.1 parent 5ebc06b commit 1d25c1c
3 files changed
Lines changed: 74 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1094 | 1094 | | |
1095 | 1095 | | |
1096 | 1096 | | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
1097 | 1110 | | |
1098 | 1111 | | |
1099 | 1112 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
28 | 37 | | |
29 | 38 | | |
30 | 39 | | |
31 | 40 | | |
32 | 41 | | |
33 | 42 | | |
34 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
13 | 20 | | |
14 | 21 | | |
15 | 22 | | |
16 | | - | |
| 23 | + | |
17 | 24 | | |
18 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
19 | 32 | | |
20 | | - | |
21 | | - | |
| 33 | + | |
22 | 34 | | |
23 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
0 commit comments