Skip to content

Add ability to collect launch information from bazel run#2774

Merged
brentleyjones merged 2 commits intomasterfrom
bj/add-ability-to-collect-launch-information-from-bazel-run
Sep 5, 2025
Merged

Add ability to collect launch information from bazel run#2774
brentleyjones merged 2 commits intomasterfrom
bj/add-ability-to-collect-launch-information-from-bazel-run

Conversation

@brentleyjones
Copy link
Copy Markdown
Collaborator

@brentleyjones brentleyjones commented Aug 22, 2025

By specifying a path with BAZEL_APPLE_LAUNCH_INFO_PATH, bazel run of an application will write the following JSON to that file:

  • platform: The string device if running on a device, otherwise the lldb platform (e.g. ios-simulator).
  • udid: The UDID of the device.
  • pid: The PID of the launched application.

This information can be used to attach lldb to the running application.

Since devicectl waits until the process exists before writing to --json_output, you’ll need to use BAZEL_DEVICECTL_LAUNCH_FLAGS to not use --console.

By specifying a path with `BAZEL_APPLE_LAUNCH_INFO_PATH`, `bazel run` of an application will write the following newline-separated information to that file:
* The string `device` if running on a device, otherwise the lldb platform (e.g. `ios-simulator`).
* The UDUD of the device.
* The PID of the launched application.

This information can be used to attach `lldb` to the running application.

Since `devicectl` waits until the process exists before writing to `--json_output`, you’ll need to use `BAZEL_DEVICECTL_LAUNCH_FLAGS` to not use `--console`.

Signed-off-by: Brentley Jones <[email protected]>
@brentleyjones
Copy link
Copy Markdown
Collaborator Author

brentleyjones commented Aug 22, 2025

Maybe the format of the file should be json, to allow us to add more to it in the future?

Edit: Yeah, going to do that.

Signed-off-by: Brentley Jones <[email protected]>
@brentleyjones brentleyjones enabled auto-merge (squash) August 22, 2025 18:37
@brentleyjones brentleyjones merged commit 1133a5f into master Sep 5, 2025
11 checks passed
@brentleyjones brentleyjones deleted the bj/add-ability-to-collect-launch-information-from-bazel-run branch September 5, 2025 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants