feat(ncm): ship go-ncm as a standalone release binary - #805
Open
danielpaulus wants to merge 1 commit into
Open
Conversation
Move the go-ncm main from cmd/cdc-ncm into the ncm module at ncm/cmd/go-ncm so the CDC-NCM driver module is self-contained, and add a --version flag (stamped via -ldflags -X main.version). The release workflow now builds go-ncm for linux amd64+arm64 natively on amd64/arm64 runners (cgo + libusb rules out easy cross-compilation) and attaches go-ncm-linux.zip as a release asset, so other tools like pymobiledevice3 can fetch the driver binary directly. release-canary.yml mirrors the build and packaging steps to prove the path without cutting a release. Fixes #538 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J8eMENxJ1nec9CeHp4tjWk
Owner
Author
|
/test-devices |
Contributor
Contributor
|
❌ Real-device tests failed — see run. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
ios listand device resolution are tied to local usbmuxd discovery. On a host that can reach an iOS 17+ RSD/userspace tunnel (e.g. a remote-device bridge where the phone is physically attached to another machine),ios listreturns{"deviceList": []}and commands likersd ls/infofail early withDevice not found: <udid>— even when the user passes explicit--address/--rsd-port/--userspace-portcoordinates that are perfectly reachable.Design
Two additions, both on the CLI/resolution layer:
Second discovery source for
ios list. The list command now also queries the go-ios tunnel agent's existing/tunnelsHTTP API (via the existingtunnel.ListRunningTunnels, honoring--tunnel-info-host/--tunnel-info-port/GO_IOS_AGENT_HOST/GO_IOS_AGENT_PORT) and merges tunnel-backed devices that usbmuxd does not report into the output. Merged entries carry a distinct transport marker:connectionType: "userspaceTunnel"(or"tunnel"for kernel TUN tunnels). usbmuxd entries win for devices known to both sources.ios listonly hard-fails if both usbmuxd and the tunnel agent are unreachable. In--detailsmode, tunnel-only devices are listed with identity + transport instead of dying on the unreachable usbmuxd/lockdown path.Direct-target resolution. When
--addressand--rsd-portare supplied, a device missing from usbmuxd is no longer fatal: theDeviceEntryis built from the explicit coordinates,--userspace-port(+--userspace-host) is preserved as the local forward endpoint, and--udidis treated as identity metadata. If no--udidis given, the UDID from the RSD handshake response is used. The RSD handshake itself is unchanged and still validated eagerly.Implementation
cli_device_resolution.goresolveDevice: the explicit--address/--rsd-portbranch now runs before theDevice not foundexit; on usbmuxd miss it builds adirectTargetDeviceentry instead of failing.directTargetDevice,tunnelBackedDevices(queries/tunnels),tunnelBackedDeviceEntry,mergeTunnelDevices,isTunnelOnlyDevice, plus theconnectionTypeTunnel/connectionTypeUserspaceTunnelmarkers.main.goprintDeviceList(details, tunnelInfo): merges the tunnel source, tolerates a missing usbmuxd when the tunnel agent answers (warns instead of exiting).detailsEntryForDevice: shared by JSON/no-JSON detailed output; skips lockdownGetValuesfor tunnel-only entries.deviceWithRsdProvider: whenGetDeviceWithAddressfails after a successful RSD handshake, keep the direct-target entry (attach the handshake'sRsdPortProvider, backfill the UDID from the handshake) instead of exiting.cmd_global.go: pass the tunnel-info config into the list command.ios/tunnel/tunnel_api.gois untouched (read-side only via the existingListRunningTunnels), deliberately avoiding overlap with the concurrent TunnelManager rework.Options considered
/tunnelsintoios list+ direct--address/--rsd-porttarget path (chosen). Reuses the tunnel agent API and the existing RSD plumbing (NewWithAddrPortDevice+Handshake), keeps changes additive and on the CLI layer, and matches what users expect (ios listshows reachable devices; explicit coordinates just work). This is also intentionally aligned with the Proposal: reuse Apple's CoreDevice tunnel on macOS instead of bringing up our own #713 Phase-1 direction: it's the same resolver-source plumbing (tunnel agent as a device source next to usbmuxd) that a future multi-source resolver can formalize, without committing to new library API now.ios rsd list). Works, but users would still hit thedeviceList: []/ "Device not found" wall in normal commands; discoverability is poor.Test plan
cli_device_resolution_test.go(device-free, run in CI) against a fake tunnel-agent HTTP server on 127.0.0.1:/tunnelsentries convert + merge into an empty usbmux list with correct udid, address, userspace TUN fields, anduserspaceTunnel/tunneltransport markers.--address/--rsd-portwith--udidas identity metadata (and empty UDID left for the RSD handshake to fill).printDeviceListoutput contains the tunnel-only device.--detailsoutput labels tunnel-only devices with the transport marker instead of failing.go build ./...,go test ./...(all green),gofmt -lclean on changed files./test-devices).Fixes #538
🤖 Generated with Claude Code
https://claude.ai/code/session_01J8eMENxJ1nec9CeHp4tjWk