feat(revyl): install local builds and start sessions without an app

Merged
KA
7h ago
+1042-140

Summary

connect revyl no longer requires --provider-app. Without it, the device starts with no app, and install puts a local build on it, so an agent can install what it just built without hosting the build first. --provider-app behaves as before.

install and install-from-source stream the build to the session's storage, then install it with install_async, polling install_status through host-kit's pollUntilSettled against one Deadline. The whole install gets a 420 s budget inside the command's 480 s envelope, so a slow install fails with the plugin's error instead of a daemon reset.

reinstall refuses with UNSUPPORTED_OPERATION (unsupported-provider-mode). Revyl has no uninstall, and an install over an app keeps its data, so it cannot give the clean app reinstall promises. revyl.md and the capabilities table say so.

An app-less connect reports a deferred device and a missing app, the state the connect workflow answers with install before open.

Packing a .app directory has one owner now: packGzipTar(dir, { env, signal, timeoutMs?, fileName? }) in a new @agent-device/host-kit/gzip-tar subpath, returning { archivePath, cleanup }. It passes -- before the name and refuses an already-aborted signal. Remote's upload, daemon artifact tracking and Revyl all call it. Remote and the daemon load it with a function-scoped import(), so their eager closures don't grow. Two daemon archive tests now wait for tar to start before they fire the deadline, since that import moves the start one tick later.

agent-device connect revyl --platform ios
agent-device install com.example.app ./build/Example.app
agent-device open com.example.app

Validation

At 8716f86f8:

  • check:affected --run --head passed every step through vitest-related.
  • unit: 20,154 passed and 2 failed. Both failures are -Werror Swift tests, which need the iphonesimulator SDK this Mac lacks.
  • New tests cover the packer (single top-level entry, a name starting with -, cleanup after a failed or aborted pack), a completed install without a result, the streamed upload's declared length, the reinstall refusal before any upload, and the app-less connect's next steps.

Live Revyl output

From this head's build, with the plugin packed from packages/provider-revyl. Each session was started without --provider-app, and disconnect ended each one. Local paths are shortened.

connect revyl --platform ios:

Connected successfully with Revyl.
Verified: Credentials verified; Revyl picks the device when the session starts.
Device: Provider-selected device — allocated on first device command
App: not available — No app URL; the device starts without one. Install a build, then open it.
No live device session has been created. The first device command shown below will allocate one.
Next:
  agent-device install <bundle-id> <app-path-or-url> --session revyl-4496-ios
  agent-device open <bundle-id> --relaunch --session revyl-4496-ios

Then, on an Android session started by connect revyl --platform android:

$ agent-device install-from-source https://github.com/appium/android-apidemos/releases/download/v6.0.18/ApiDemos-debug.apk --platform android --json
{
  "success": true,
  "data": {
    "launchTarget": "io.appium.android.apis",
    "appId": "io.appium.android.apis",
    "package": "io.appium.android.apis",
    "message": "Installed: io.appium.android.apis"
  }
}

$ agent-device open io.appium.android.apis
Opened: io.appium.android.apis

$ agent-device snapshot -i
Page: io.appium.android.apis
App: io.appium.android.apis
Snapshot: 22 nodes
@e6 [text] "API Demos"
@e8 [list] [focused]
@e10 [text] "Accessibility"
@e11 [text] "Animation"
@e12 [text] "App"
...

$ agent-device reinstall io.appium.android.apis ./ApiDemos-debug.apk --json
{
  "success": false,
  "error": {
    "code": "UNSUPPORTED_OPERATION",
    "message": "Revyl cannot reinstall an app: it has no uninstall, and installing over an app keeps its data.",
    "hint": "Run install to update the build in place, or start a new session for a clean app.",
    "details": {
      "reason": "unsupported-provider-mode",
      "dispatched": "unknown"
    }
  }
}

The snapshot -i output is trimmed to its labelled rows. The earlier head's live runs also installed a local .apk (Android) and a local .app directory (iOS) with plain install.

CI obligations: the Apple-runner lanes.