Skip to content

Commit 5868ace

Browse files
authored
fix: optimize remote install artifact uploads (#413)
* fix: optimize remote install artifact uploads * refactor: clean up upload client flow * fix: fall back after direct upload failure * docs: correct ios install source examples
1 parent 364844e commit 5868ace

9 files changed

Lines changed: 875 additions & 122 deletions

File tree

skills/agent-device/references/bootstrap-install.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Use this exact order when you are not sure about the installed app identifier. O
1717
## Install path
1818

1919
- `install` or `reinstall`
20+
- `install-from-source` when the artifact already exists at a URL the daemon can reach
2021

2122
## Most common mistake to avoid
2223

@@ -60,14 +61,26 @@ agent-device install com.example.app ./build/app.apk --platform android --serial
6061
agent-device install com.example.app ./build/MyApp.app --platform ios --device "iPhone 17 Pro"
6162
```
6263

64+
```bash
65+
agent-device install-from-source https://example.com/builds/app.aab --platform android
66+
agent-device install-from-source https://api.github.com/repos/acme/app/actions/artifacts/123/zip --platform ios --header "authorization: Bearer TOKEN"
67+
```
68+
6369
## Install guidance
6470

6571
- Use `install <app> <path>` when the app may already be installed and you do not need a fresh-state reset.
6672
- Use `reinstall <app> <path>` when you explicitly need uninstall plus install as one deterministic step.
73+
- Use `install-from-source <url>` when an existing artifact URL is already reachable by the daemon.
74+
- Local `.apk`, `.aab`, `.app`, and `.ipa` paths go through `install` or `reinstall`; existing reachable URLs go through `install-from-source`.
75+
- Do not download, re-zip, publish temporary GitHub releases, or move CI artifacts elsewhere just to make an install command work.
6776
- Keep install and open as separate phases. Do not turn them into one default command flow.
6877
- Supported binary formats:
6978
- Android: `.apk` and `.aab`
7079
- iOS: `.app` and `.ipa`
80+
- Android URL sources can be direct `.apk` or `.aab` files.
81+
- Trusted artifact service URLs, currently GitHub Actions and EAS, may point at archive-backed downloads that contain one installable artifact. This includes GitHub Actions artifact ZIPs whose URL path does not end in `.zip` and ZIPs containing one nested `.apk`, `.aab`, `.ipa`, or iOS `.app` tar archive.
82+
- If a trusted artifact archive contains multiple installables, stop and ask for the intended artifact instead of guessing.
83+
- `.aab` still requires `bundletool` in `PATH`, or `AGENT_DEVICE_BUNDLETOOL_JAR=<absolute-path-to-bundletool-all.jar>` with `java` in `PATH`, when the daemon installs the materialized artifact.
7184
- For iOS `.ipa` files, `<app>` is used as the bundle id or bundle name hint when the archive contains multiple app bundles.
7285
- After install or reinstall, later use `open <app>` with the exact discovered or known package/bundle identifier, not the artifact path.
7386

skills/agent-device/references/remote-tenancy.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ agent-device connect \
2727
--remote-config ./remote-config.json
2828

2929
agent-device install com.example.app ./app.apk
30+
agent-device install-from-source https://example.com/builds/app.apk --platform android
3031
agent-device open com.example.app --relaunch
3132
agent-device snapshot -i
3233
agent-device fill @e3 "test@example.com"
@@ -35,6 +36,20 @@ agent-device disconnect
3536

3637
`connect` resolves the remote profile, verifies daemon reachability through the normal client path, allocates or refreshes the tenant lease, prepares local Metro when the profile has Metro fields, starts the local Metro companion when the bridge needs it, and writes local non-secret connection state for later commands. `disconnect` closes the session when possible, stops the Metro companion owned by that connection, releases the lease, and removes local connection state.
3738

39+
After `connect`, normal `agent-device` commands use the active remote connection. Do not repeat `--remote-config` on every command.
40+
41+
Remote install examples:
42+
43+
```bash
44+
agent-device install com.example.app ./app.apk
45+
agent-device install-from-source https://example.com/builds/app.aab --platform android
46+
agent-device install-from-source https://api.github.com/repos/acme/app/actions/artifacts/123/zip --platform ios --header "authorization: Bearer TOKEN"
47+
```
48+
49+
- Use `install` or `reinstall` for local paths; remote daemons upload local artifacts automatically.
50+
- Use `install-from-source` for artifact URLs the remote daemon can reach.
51+
- For local-path versus URL artifact rules, follow [bootstrap-install.md](bootstrap-install.md).
52+
3853
Use `agent-device connection status --session adc-android` to inspect the active connection without reading JSON state manually. Status output must not include auth tokens.
3954

4055
## Remote config shape

0 commit comments

Comments
 (0)