Skip to content

Refactor iOS runner client into cohesive modules #155

Closed

Description

@thymikee

Problem

src/platforms/ios/runner-client.ts is currently ~1128 LOC and mixes session orchestration, xctestrun preparation, transport I/O, retry/error classification, and derived-data/build configuration concerns.

Goal

Split runner-client into cohesive modules while preserving runIosRunnerCommand behavior and runner session semantics.

Proposed split

  • src/platforms/ios/runner-session.ts
    • session map/locks/start-stop lifecycle
  • src/platforms/ios/runner-transport.ts
    • simulator/device endpoint resolution + HTTP command posting
  • src/platforms/ios/runner-xctestrun.ts
    • xctestrun discovery/prep/build settings/destination helpers
  • src/platforms/ios/runner-errors.ts
    • retryability + early-exit/connect error hint resolution
  • Keep src/platforms/ios/runner-client.ts as thin orchestration/public API.

Acceptance criteria

  • No behavior regressions for iOS simulator/device command execution.
  • Public exports remain stable.
  • New modules target <=300 LOC where practical.
  • Any file >500 LOC is explicitly justified or further split.
  • Existing runner-related unit tests remain green.

Validation

  • pnpm typecheck
  • pnpm test:unit
  • pnpm test:smoke

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions