Skip to content

fix: make devicectl launches work with debug-brk and report the pid - #89

Open
rigor789 wants to merge 1 commit into
feat/os-trace-relayfrom
fix/devicectl-debug-brk
Open

rigor789 wants to merge 1 commit into
feat/os-trace-relayfrom
fix/devicectl-debug-brk

Conversation

@rigor789

@rigor789 rigor789 commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

What is the current behavior?

On iOS 17+ devices, waitForDebugger launches with devicectl --start-stopped and never passes --nativescript-debug-brk. The process is suspended without the runtime knowing it should wait, and nothing is set up to resume it. So ns debug ios --debug-brk doesn't stop for a debugger.

What is the new behavior?

  • The app is launched running, with --nativescript-debug-brk, as the pre-iOS 17 path already does. The runtime does the waiting.
  • App arguments go after devicectl's own options. run_devicectl appended --quiet --json-output to the end, which would have handed them to the app.
  • The start response includes pid on iOS 17+. The CLI uses it to attach a native debugger, because iOS kills an app that takes about 20 seconds to launch.

Testing

Tested with the CLI and runtime PRs below on an iPad on iPadOS 26.7: a demo app waited, a CDP client connected, the app stayed paused for 40 seconds, then resumed and ran. JS tests pass. Devices below iOS 17 weren't tested, and that path is unchanged.

Part of a stack

Base: #88. All of these are needed for --debug-brk on devices:

--start-stopped suspends the process without telling the runtime to wait for a debugger, so nothing resumes it. The app now gets --nativescript-debug-brk like the pre-iOS 17 path, and the runtime waits. App arguments have to come after devicectl's own options. The start response includes the pid, so the CLI can attach a native debugger.
@coderabbitai

coderabbitai Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c1c5b3a8-83de-46bf-9735-f561c7a1702d
Commits

Reviewing files that changed from the base of the PR and between 03c918c and 227f87d.

Files selected for processing: 5
  • IOSDeviceLib/Constants.h
  • IOSDeviceLib/DevicectlHelper.cpp
  • IOSDeviceLib/DevicectlHelper.h
  • IOSDeviceLib/IOSDeviceLib.cpp
  • typings/interfaces.d.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pkg-pr-new

pkg-pr-new Bot commented Oct 30, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/ios-device-lib@89

commit: 227f87d

@rigor789
rigor789 added this pull request to stack #90 October 30, 2026 22:21

This branch has not been deployed

No deployments
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.

1 participant