Skip to content

☂️ Use LLDB and devicectl to launch and debug apps on iOS 17+ physical devices. #173416

@vashworth

Description

@vashworth

Problem

Currently, we launch and debug apps for iOS 17+ physical devices through Xcode automation (AppleScript). This has become flakey with Xcode 26 beta 4 (at least).

When running flutter run more than once in a row, AppleScript will fail to connect to Xcode and therefore fail to install, launch, and debug the app: #144218 (comment)

This will make flutter run highly unstable.

Plan

To fix this, we plan to switch to using devicectl (for installing and launching) and lldb (for debugging) and move away from AppleScript. This is a big change (see prototype) that will likely need to be cherrypicked.

To reduce the risk, we plan to do split this out into 3 PRs:

  • 1. Add new classes and methods, but do not use them yet.
    • This will be a large change, but safe to cherry-pick since the new code will not be used yet.
  • 2. Switch deployment to use new code.
    • To reduce risk, we will also:
      • Put the LLDB deployment method behind a feature flag (enabled by default) that can be disabled if it fails
      • Use AppleScript as a fallback if LLDB fails
      • This will be a smaller PR and easier to revert in the worst case
  • 3. Add telemetry to track what deployment method is used and if it's successful or not

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work listteam-iosOwned by iOS platform teamtriaged-iosTriaged by iOS platform team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions