tools/manual_tests/ohos-device-smoke.md
Verify that a signed arm64 HAP produced from the CargoKit create example can be
installed on an OHOS/HarmonyOS device, start EntryAbility, load the packaged
Rust library, complete a Dart-to-Rust call, and clean up the test application.
website/docs/guides/miscellaneous/harmony-os.md,
.claude/skills/frb-manual-test/SKILL.mdRun after changing OHOS HAP packaging, CargoKit OHOS integration, the
ohos-device-smoke command, the OHOS Flutter toolchain, or the dedicated smoke
entrypoint. Run before claiming real-device coverage in a PR or release.
fzyzcjy/flutter_rust_bridgefrb_example/flutter_via_create/ohos/ohos_device_smoke_main.dart.hdc,
developer mode enabled, and the HAP bundle not already installed.aarch64-unknown-linux-ohos target installed.hdc.git submodule update --init --recursive
hdc list targets
rustup target add aarch64-unknown-linux-ohos
Set OHOS_SDK_HOME to the installed native SDK directory. Configure a dedicated
bundle name in frb_example/flutter_via_create/ohos/AppScope/app.json5, then
configure local debug signing without committing the signing material.
frb_example/flutter_via_create.Build the dedicated smoke entrypoint.
cd frb_example/flutter_via_create
flutter build hap --debug \
--target ohos/ohos_device_smoke_main.dart
Confirm the HAP contains the expected arm64 Rust library and note the signed HAP path and configured bundle name.
unzip -l /absolute/path/to/entry-default-signed.hap | \
grep 'libs/arm64-v8a/librust_lib_flutter_via_create.so'
From the repository root, execute the device smoke command with the exact bundle recorded in the HAP metadata.
./frb_internal ohos-device-smoke \
--hap /absolute/path/to/entry-default-signed.hap \
--bundle com.example.frb_ohos_smoke \
--ability EntryAbility
Query installed bundles and confirm the dedicated bundle was removed.
bundles="$(hdc shell bm dump -a)" || exit 1
if printf '%s\n' "$bundles" | grep -Fq 'com.example.frb_ohos_smoke'; then
echo 'bundle still installed' >&2
exit 1
fi
The build and smoke commands exit zero, the HAP contains the Rust shared library, the device log contains the exact current-launch marker, and cleanup removes the dedicated bundle.
OHOS device smoke passed: ... marker=FRB_OHOS_SMOKE_RESULT=PASS ...
The test fails or is blocked if any of the following occurs:
--bundle or is already installed.flutter --version, dart --version, rustc --version, and device ID.target/ohos_device_smoke.runtimeOS, compatible SDK, native SDK, and device type exist locally.hdc list targets and mark the run blocked.The smoke command uninstalls only the bundle it installed. After an install failure, it queries the device again and removes the bundle if it appeared. Restore any temporary SDK, bundle, or signing configuration and verify the checkout afterwards.
git status --short
Move this test to a dedicated arm64 OHOS/HarmonyOS device runner once secure HAP signing and exclusive device allocation are available in CI.