Files
sanderling/examples/sample-app
pj c1de4bf57a fix(sample-app): address PR #18 review findings (#19)
- WebLedgerStore.accountExistsByName case-insensitive (matches SQL COLLATE NOCASE)
- drop SampleApplication.maybeInjectDebugError; sample spec now passes clean
- drop noLogcatErrors from sample spec (default matches system-wide E logs)
- openRandomAccount picks uniformly from findAll instead of first match
- clear txnError on any add-transaction interaction, not only valid amount input
- escapeForAdbInputText quotes shell metacharacters (quotes, backslash, etc.)
- extract buildClearKeyevents helper with empty/normal/cap tests
- broaden spec_integration_test.go to cover home, add-account, ledger,
  add-transaction action generators
- document FocusTracker single-focus invariant
2026-04-20 13:31:50 +07:00
..

uatu sample app

A minimal Kotlin Multiplatform ledger app that mirrors the React reference: login with demo credentials, create accounts, add credits and debits. Same features, monospace look, and demo creds, shared across Android and iOS via Compose Multiplatform.

Stack

  • Kotlin Multiplatform + Compose Multiplatform (shared UI)
  • kotlinx.serialization for file-backed persistence
  • kotlinx.coroutines for state flows
  • uatu sdk-android for harness integration on Android

Everything in composeApp/src/commonMain/kotlin/dev/uatu/sample/ is shared between platforms. Platform-specific I/O (file storage, clock, UUID) lives in androidMain/ and iosMain/ as actuals of the Platform expect object.

Prerequisites

  • just
  • JDK 17
  • Android SDK (auto-discovered under $ANDROID_HOME, ~/Library/Android/sdk, or the Homebrew cask)
  • Xcode 16+ and xcodegen (brew install xcodegen) for iOS

Android

just install      # build + install on a booted emulator / device
just uninstall
just clean

iOS

just ios                          # default device: iPhone 17 Pro
IOS_DEVICE="iPhone 15" just ios   # pick a different simulator

just ios regenerates iosApp/iosApp.xcodeproj from iosApp/project.yml, builds the KMP framework, links it into the SwiftUI host, installs, and launches.

Demo credentials

email:    [email protected]
password: ledger123

Run a uatu test (Android)

just test

If no device is connected, uatu boots the single AVD it finds. With multiple AVDs, pick one:

just AVD=Pixel_7 test

Persistent settings can live in .env alongside the justfile:

AVD=Pixel_7
DURATION=5m

Traces land in ./runs/<timestamp>/.

Layout

composeApp/
  src/commonMain/kotlin/dev/uatu/sample/   shared domain, state, UI
  src/androidMain/                         Android Application + Activity
  src/iosMain/                             iOS UIViewController entry
iosApp/
  project.yml                              xcodegen spec
  iosApp/iOSApp.swift                      SwiftUI host
  iosApp/Info.plist
justfile
spec.ts                                    uatu test spec

How it connects to uatu

  • composeApp/src/androidMain/.../SampleApplication.kt calls Uatu.start(this) and registers snapshot extractors (logged_in, account_count, total_balance, route)
  • spec.ts imports @uatu/spec, reads those snapshots, asserts properties, and weights the actions the fuzzer picks from
  • just test invokes uatu test against the installed APK