refactor(ios): remove iproxy spawn from device runner

This commit is contained in:
pj committed 2026-06-09 16:50:57 +05:30
1 parent 033b17a102
commit 46f828d0be
2 files changed
-27

No files matched your search

@@ -248,25 +248,6 @@ func testWithoutBuildingArgs(xctestrunPath, hardwareUDID string, creds signingCr
}
}
// iproxyArgs forwards the host loopback localPort to the device devicePort over
// usbmux for the device selected by hardwareUDID.
func iproxyArgs(localPort, devicePort, hardwareUDID string) []string {
return []string{"iproxy", localPort + ":" + devicePort, "-u", hardwareUDID}
}
// spawnTunnel opens the usbmux tunnel via iproxy. SIGTERM on cancel closes the
// forwarded sockets cleanly so no orphan lingers.
func spawnTunnel(ctx context.Context, hardwareUDID, localPort, devicePort string) (*exec.Cmd, error) {
args := iproxyArgs(localPort, devicePort, hardwareUDID)
command := exec.CommandContext(ctx, args[0], args[1:]...)
command.Cancel = func() error { return command.Process.Signal(syscall.SIGTERM) }
command.WaitDelay = shutdownGrace
if err := command.Start(); err != nil {
return nil, fmt.Errorf("start iproxy: %w", err)
}
return command, nil
}
// locateDeviceXctestrun finds the device build's xctestrun under the derived
// data products. The name embeds the device SDK version, so it is discovered
// rather than hardcoded.
@@ -52,14 +52,6 @@ func TestTestWithoutBuildingArgs(t *testing.T) {
}
}
func TestIproxyArgs(t *testing.T) {
args := iproxyArgs("49200", "27753", "00008140-HW")
want := []string{"iproxy", "49200:27753", "-u", "00008140-HW"}
if !equalArgs(args, want) {
t.Fatalf("iproxy args = %v, want %v", args, want)
}
}
func TestXcodegenArgs(t *testing.T) {
args := xcodegenArgs("/c/project.yml")
want := []string{"xcodegen", "--spec", "/c/project.yml"}