Lease files: push a file or folder into an app's container

オープン
#2,006 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
android, ios, typescript

調査の方向性

This spans the CLI, HTTP route, lease-files service, daemon, core driver catalog, and iOS and Android drivers; start with the linked technical spec at commit d95c152c6 and the listed seams in src/daemon/lease-files.test.ts, src/drivers/android/index-device-tcp.test.ts, and src/drivers/ios/device-tcp.test.ts. Follow the module flow from src/cli/commands/files.ts through the gateway to each driver, then use the listed real-device slow-lane checks to confirm files can be pushed and read back while container modes remain intact.

索引モデルが issue の本文から書いたものです。

説明

task:ready

Part of #1636.

Scope

simlock files push <name> --app <id> --to <path> copies a stored file or folder into the data container of an app on the lease's iOS simulator, Android emulator or Android phone, on a worker and through a gateway.

If it goes wrong, files land outside the app's container or in another app, the app can no longer be reached by run-as, or a lease's end hangs on a copy.

Technical spec

Commit d95c152c6.

Rows
  • Behaviours: B11, B12, B13, B14, B15, B16
  • Stored state: S4
  • Interfaces: I6, I7, I12, I13
  • Existing code: X3, X5, X7, X10, X12, X13, X14
Facts
# Fact Source
F1 With a debuggable app on the Android 15 default and the Android 16 Play image, the commands of I6 and I9 exit 0 and every byte comes back, path with a space and a quote included the rows' own command lines through adb -s emulator-5690, 2026-11-30, both images: untar 0, tar 0, equal shasum
F2 An archive with a ./ entry of mode 755 unarchived into . makes run-as refuse the app; one with entries for files, links and empty folders only, under umask 022, leaves the modes of . and files, twice in a row the same emulators: run-as: /data/user/0/dev.t1636dbg readable or writable by others: 40755 before, drwx------ . and drwxrwx--x files after
F3 run-as exits 1 with package not debuggable: X, unknown package: X or package not an application: X on stderr the same emulators, adb shell "run-as <app> sh -c :"
F4 simctl get_app_container <udid> <app> data exits 2 for an unknown app, and prints (null) with exit 0 for a system app xcrun simctl get_app_container on iOS 27.2, 2026-11-30
F5 A relay waits 330 s for an answer src/gateway/relay.ts:42
F6 The Android fixture app is debuggable, and the iOS one is a simulator build aapt2 dump badging e2e/fixtures/appduct/android/AppductPlayground.apk: application-debuggable
F7 DeviceTcp is the capability to model on: the driver member, the catalog call, the fake src/core/driver.ts:408, src/core/driver-catalog.ts:141, src/core/fake-device-tcp.ts
Modules touched

core (app-files.ts, driver.ts, driver-catalog.ts, fake-driver.ts, testing.ts), drivers/ios (app-files.ts, index.ts), drivers/android (app-files.ts, index.ts, passthrough-rules.ts, physical-handler.ts), lease-files, http (lease-declarations.ts, app.ts), contract (errors.ts, the protocol bump), daemon (worker-composition.ts, gateway-lease-files.ts), ports (http-stream.ts), cli (commands/files.ts, the help in src/cli/index.ts), website (copy-files, cli, errors, the OpenAPI document), e2e/slow-remote-cli.test.ts. Searches: rg -l DeviceTcp src, rg "runAdbOn|runAdb\b" src, rg "HttpStreamRequest" src.

flowchart LR
  C[cli files push] --> H[http route]
  H --> L[lease-files]
  L --> W[daemon worker-composition]
  W --> K[core driver catalog]
  K --> I[drivers/ios app-files]
  K --> A[drivers/android app-files]
Rules in play
  • ADR 0100 §3, §4: an archive on the worker's disk, adb push, no file through adb shell, no change of the device's state.
  • src/drivers/AGENTS.md: the capability takes core's shapes; no driver imports lease-files or the contract.
  • ADR 0048 and src/drivers/ios/AGENTS.md: simctl runs on the device set the driver is scoped to.
  • .dependency-cruiser.mjs lease-files-imports-little: lease-files takes appFiles as a dependency and never sees a driver.
  • Safety rule 10: app, to and the body are bounded before they reach a command line.
  • src/contract/AGENTS.md Protocol version: one bump for the three new codes.
  • Documentation rule 9: the pages above and the codes in the errors reference; the docs say to stop the app before a push.
Tests

Seams: createLeaseFiles with FakeAppFiles (model: src/daemon/lease-files.test.ts), the drivers with ScriptedProcessRunner (src/drivers/android/index-device-tcp.test.ts, src/drivers/ios/device-tcp.test.ts), runCli (src/cli/index-files.test.ts), the gateway pair (src/daemon/relay-gateway-files.e2e.test.ts).

  • B11: An HTTP caller pushes a stored file or folder through I7; sees 200, the driver was handed an archive of it, and no archive is left: folder's contents; empty folder; one file; link out left out; each refused path of Examples; Documents/ echoed as Documents; a bad app id; a body that is no JSON, too long or without a field; unknown stored name; no driver capability or an iPhone (APP_FILES_UNSUPPORTED); UNKNOWN_APP; APP_FILES_FAILED; a file that shrinks while it is archived; disk low; 300 s (answered though the driver has not returned); caller goes away (runs on); lease ends during it
  • B12: The iOS driver writes the archive into the simulator's data container: new and existing folders; a file replaced; others kept; app unknown (exit 2); (null) printed; another simctl failure; link in the path that leads out; . ; aborted; physical device unsupported
  • B13: The Android driver pushes the archive and has the device unarchive it, on an emulator and a phone, and removes its temporary folder after a success and after a failure: emulator; phone; path with a space and a quote; an archive with no entry (the folder is made, nothing is pushed); what an earlier copy left is removed first; unknown package; package that is no application; not debuggable; adb push fails; unarchiving fails; the removal fails (the copy still succeeds); emulator without a serial; phone behind a closed gate; a step that times out; aborted; two copies on one device run one after the other, on two devices together
  • B14: simlock files push prints the reply of How it works: success; an answer after 200 s; none after 360 s (REMOTE_UNREACHABLE); missing --app or --to (exit 2); a name that is no file name (exit 2, nothing sent); BAD_REQUEST exits 2, each other error of I7 keeps its code and exits 1
  • B15: A gateway relays a push, and its refusals carry the caller's lease id: success; UNKNOWN_APP; worker not connected
  • B16: simlock files push then a read in the container, on a real simulator and a real emulator with a debuggable app: iOS; Android; on Android a folder with files/ in it to ., twice, after which the container and files have the modes they had

Done when

  • The Android driver spawns no streaming child for a copy: rg spawnStreaming src/drivers/android/app-files.ts prints nothing.
  • website/scripts/check-openapi.mjs passes with POST /v1/leases/{id}/files/{name}/push.
  • Slow lane (real simulator and real emulator): new cases in e2e/slow-remote-cli.test.ts push a folder into the container of the Appduct fixture app and read it back with simctl get_app_container and adb shell run-as; the emulator's also pushes a folder holding files/ to . twice and compares the modes of the container and files.

Out of scope

Real iPhones and iPads, release Android apps, stopping the app, app groups. Pulling (#2007).

Depends on

  • #2004 because: TreeArchive and the route action of LeaseFiles.handle
  • #2005 because: PROTOCOL_VERSION_RANGE and openFile in src/lease-files/store.ts

Written by an agent.

主要言語
TypeScript
スター
730
フォーク
44
平均マージ
15時間 28分
マージ済み PR(30日)
387

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

callstackincubator/simlock のほかの issue

callstackincubator/simlock の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。