danielpaulus / go-ios

This is an operating system independent implementation of iOS device features. You can run UI tests, launch or kill apps, install apps etc. with it.
MIT License
974 stars 184 forks source link

iOS17 linux error: ManualPairAndConnectToTunnel: failed to find device ethernet interface #380

Open Rodionp13 opened 8 months ago

Rodionp13 commented 8 months ago

Good day @danielpaulus , first of all thanks a lot for your great work ! Env:

Executed command: sudo ./go-ios --udid tunnel start --pair-record-path

Expectation: info about some kind of MacOS analogue of utun interface. (Or something similar as in pymobiledevice solution);

Actual:

{"level":"info","msg":"no udid specified using first device in list","time":"2024-03-12T12:30:31Z","udid":"UDID"}
{"level":"info","msg":"start tunnel","time":"2024-03-12T12:30:32Z","udid":"UDID"}
{"error":"ManualPairAndConnectToTunnel: failed to find device ethernet interface: context deadline exceeded","level":"warning","msg":"failed to start tunnel","time":"2024-03-12T12:30:42Z","udid":"UDID"}
{"level":"info","msg":"start tunnel","time":"2024-03-12T12:30:42Z","udid":"UDID"}
{"error":"ManualPairAndConnectToTunnel: failed to find device ethernet interface: context deadline exceeded","level":"warning","msg":"failed to start tunnel","time":"2024-03-12T12:30:52Z","udid":"UDID"}

and this continued in loop as far as I understood. When I connected device to host Trust popup occured but that was okay as I connected the device first time and that was standard paring process. (If I'm not mistaking). Error description seems to me straightforward but how can I manage one on my side? (Or this is some kind of bug ?)

Could you please help/explain me what did I do wrong?)

Rodionp13 commented 8 months ago

UPDATE: (Sorry for large response, just want to make sure that I did all steps correctly (or not)) finally I built and run go-ncm binary and after that tunnel start created the virt interface iphone0 (ifconfig showed one).

go-ncm
2024/03/12 14:20:52 INFO usbmuxd version version=1.1.1-56-g360619c
2024/03/12 14:20:52 INFO prometheus metrics not configured. start with '--prometheusport=8080' to expose prometheus metrics.
2024/03/12 14:20:57 INFO assigning interface iface=iphone0 serial=<udid>
2024/03/12 14:20:57 INFO got device serial=<udid>
2024/03/12 14:20:57 INFO active config active=5 serial=<udid>
2024/03/12 14:20:57 INFO available configs configs="map[1:Configuration 1 2:Configuration 2 3:Configuration 3 4:Configuration 4 5:Configuration 5]" len=5 serial=<udid>
2024/03/12 14:20:57 INFO got config config="vid=05ac,pid=12a8,bus=1,addr=94,config=5" serial=<udid>
2024/03/12 14:20:57 INFO alt setting alt="Interface 3 alternate setting 1 (available endpoints: [0x05(5,OUT) 0x86(6,IN)])" class=10 subclass=0 protocol=1 serial=<udid>
2024/03/12 14:20:57 INFO alt setting alt="Interface 5 alternate setting 1 (available endpoints: [0x06(6,OUT) 0x87(7,IN)])" class=10 subclass=0 protocol=1 serial=<udid>
2024/03/12 14:20:57 INFO 0x87
2024/03/12 14:20:57 INFO 0x06
2024/03/12 14:20:57 INFO claimed interfaces serial=<udid>
2024/03/12 14:20:57 INFO created streams serial=<udid>
2024/03/12 14:20:57 INFO creating TAP device device=iphone0 serial=<udid>
2024/03/12 14:20:57 INFO add IP address to device device=iphone0 serial=<udid> ip=FC00:0000:0000:0000:0000:0000:0000:00FB/64
2024/03/12 14:20:57 INFO ethernet device is up: device=iphone0 serial=<udid>

Sometime I see such error in logs (do not know its importance though) 2024/03/12 14:21:17 handle_events: error: libusb: interrupted [code -10]

go-ios tunnel start --pair-record-path <record_path>
{"level":"info","msg":"no udid specified using first device in list","time":"2024-03-12T14:21:09Z","udid":"<udid>"}
{"level":"info","msg":"start tunnel","time":"2024-03-12T14:21:10Z","udid":"<udid>"}
{"level":"info","msg":"create tunnel listener","time":"2024-03-12T14:21:11Z"}
{"address":"fe80::10f7:8ff:fe56:180d%iphone0","level":"info","msg":"connect to tunnel endpoint on device","port":53809,"time":"2024-03-12T14:21:12Z"}

But developer command I invoked (and some others too) returned with errors:

go-ios --udid <udid> screenshot
{"err":"Could not start service:com.apple.mobile.screenshotr with reason:'InvalidService'. Have you mounted the Developer Image?","level":"fatal","msg":"Starting Screenshotr failed with","time":"2024-03-12T14:25:53Z"}

go-ios --udid <udid> --tunnel-info-port <port> --address <addr> screenshot
{"level":"warning","msg":"failed to get tunnel info","time":"2024-03-12T14:25:39Z","udid":"<udid>"}
{"err":"Could not start service:com.apple.mobile.screenshotr with reason:'InvalidService'. Have you mounted the Developer Image?","level":"fatal","msg":"Starting Screenshotr failed with","time":"2024-03-12T14:25:39Z"}

Dev image has been mounter successfully, command go-ios tunnel ls returned the response

go-ios tunnel ls
{"level":"info","msg":"no udid specified using first device in list","time":"2024-03-12T14:33:12Z","udid":"<udid>"}
[
  {
    "address": "fddd:1c9d:84ef::1",
    "rsdPort": 50511,
    "udid": "<udid>"
  }
]
Rodionp13 commented 8 months ago

UPDATE:

finally I started dev. commands (screenshot, setlocation etc.) with -v flag and saw HTTP2 handshake bypassed, that was great news. But service start procedure was not succeeded. Is it possible that tool started services by old (NOT iOS-17 suitable) service names ?

haryshi commented 8 months ago

Good day @danielpaulus , first of all thanks a lot for your great work ! Env:

  • host: Linux (Ubuntu 18.04.5 LTS);
  • device production version: iOS-17.4;
  • fresh usbmuxd installed (may be it's not required though. Did not inspect go-ios proj sources regarding to communication with unix socket);

Executed command: sudo ./go-ios --udid tunnel start --pair-record-path

Expectation: info about some kind of MacOS analogue of utun interface. (Or something similar as in pymobiledevice solution);

Actual:

{"level":"info","msg":"no udid specified using first device in list","time":"2024-03-12T12:30:31Z","udid":"UDID"}
{"level":"info","msg":"start tunnel","time":"2024-03-12T12:30:32Z","udid":"UDID"}
{"error":"ManualPairAndConnectToTunnel: failed to find device ethernet interface: context deadline exceeded","level":"warning","msg":"failed to start tunnel","time":"2024-03-12T12:30:42Z","udid":"UDID"}
{"level":"info","msg":"start tunnel","time":"2024-03-12T12:30:42Z","udid":"UDID"}
{"error":"ManualPairAndConnectToTunnel: failed to find device ethernet interface: context deadline exceeded","level":"warning","msg":"failed to start tunnel","time":"2024-03-12T12:30:52Z","udid":"UDID"}

and this continued in loop as far as I understood. When I connected device to host Trust popup occured but that was okay as I connected the device first time and that was standard paring process. (If I'm not mistaking). Error description seems to me straightforward but how can I manage one on my side? (Or this is some kind of bug ?)

Could you please help/explain me what did I do wrong?)

@Rodionp13 I met the same issue, could you please provide a detail steps of resolving the problem, how to "built and run go-ncm binary" ? Thanks!

Rodionp13 commented 8 months ago

Hi @haryshi, you need to invoke make command in root go-ios directory. Then go-ncm binary will be built. You should invoke it before any tunnel invokation:

cd go-ios && make && sudo ./go-ncm;
./go-ios tunnel start --pair-record-path <record_path>;

then as far as I understood you need to use rsdPort from command ./go-ios tunnel ls

Have a good day !

Rodionp13 commented 8 months ago

@haryshi but nobody else is complaining... may be we still do something wrong ...=)

Schlaubischlump commented 7 months ago

I encounter the same error on macOS. I first needed to disable SIP, since otherwise the pair records couldn't be read. However, even after that I get the ManualPairAndConnectToTunnel error when I use tunnel start. Is iOS 17 just not supported yet on macOS or is there something I'm missing? (btw. go-ncm is linux only)

takov751 commented 7 months ago

What i have found interesting that with ios 17.4 pymobiledevice3 started using mobdev2 protocol for tunneling over LAN . It does have minor bugs for example tunnel connection stops when phone screen locks and tunnel crashes , but slowly getting there. And i tested it on linux so there's that

lnguyen234 commented 7 months ago

UPDATE: (Sorry for large response, just want to make sure that I did all steps correctly (or not)) finally I built and run go-ncm binary and after that tunnel start created the virt interface iphone0 (ifconfig showed one).

go-ncm
2024/03/12 14:20:52 INFO usbmuxd version version=1.1.1-56-g360619c
2024/03/12 14:20:52 INFO prometheus metrics not configured. start with '--prometheusport=8080' to expose prometheus metrics.
2024/03/12 14:20:57 INFO assigning interface iface=iphone0 serial=<udid>
2024/03/12 14:20:57 INFO got device serial=<udid>
2024/03/12 14:20:57 INFO active config active=5 serial=<udid>
2024/03/12 14:20:57 INFO available configs configs="map[1:Configuration 1 2:Configuration 2 3:Configuration 3 4:Configuration 4 5:Configuration 5]" len=5 serial=<udid>
2024/03/12 14:20:57 INFO got config config="vid=05ac,pid=12a8,bus=1,addr=94,config=5" serial=<udid>
2024/03/12 14:20:57 INFO alt setting alt="Interface 3 alternate setting 1 (available endpoints: [0x05(5,OUT) 0x86(6,IN)])" class=10 subclass=0 protocol=1 serial=<udid>
2024/03/12 14:20:57 INFO alt setting alt="Interface 5 alternate setting 1 (available endpoints: [0x06(6,OUT) 0x87(7,IN)])" class=10 subclass=0 protocol=1 serial=<udid>
2024/03/12 14:20:57 INFO 0x87
2024/03/12 14:20:57 INFO 0x06
2024/03/12 14:20:57 INFO claimed interfaces serial=<udid>
2024/03/12 14:20:57 INFO created streams serial=<udid>
2024/03/12 14:20:57 INFO creating TAP device device=iphone0 serial=<udid>
2024/03/12 14:20:57 INFO add IP address to device device=iphone0 serial=<udid> ip=FC00:0000:0000:0000:0000:0000:0000:00FB/64
2024/03/12 14:20:57 INFO ethernet device is up: device=iphone0 serial=<udid>

Sometime I see such error in logs (do not know its importance though) 2024/03/12 14:21:17 handle_events: error: libusb: interrupted [code -10]

I tried this on a docker but go-ncm just stops at this 2024/04/26 17:03:44 INFO usbmuxd version version=1.1.2 2024/04/26 17:03:44 INFO prometheus metrics not configured. start with '--prometheusport=8080' to expose prometheus metrics.

then print out bunch of handle_events: error: libusb: interrupted [code -10] Is there anyone having the same issue?

chernyka commented 6 months ago

Having similar issue on macos with iOS 17.4.1. Http2 connection seems to get established normally but during RSD handshake http2 stream is reset by peer.

chernyka commented 6 months ago

stopping macos remoted daemod solved my issue

pkill -SIGCONT remoted
luoxiao1008 commented 2 months ago

how to do "sudo pkill -SIGSTOP remoted" on windows?

felixruan commented 2 months ago

how to do "sudo pkill -SIGSTOP remoted" on windows?

Firstly, you need to install ncm driver on windows.

felixruan commented 2 months ago

UPDATE: (Sorry for large response, just want to make sure that I did all steps correctly (or not)) finally I built and run go-ncm binary and after that tunnel start created the virt interface iphone0 (ifconfig showed one).

go-ncm
2024/03/12 14:20:52 INFO usbmuxd version version=1.1.1-56-g360619c
2024/03/12 14:20:52 INFO prometheus metrics not configured. start with '--prometheusport=8080' to expose prometheus metrics.
2024/03/12 14:20:57 INFO assigning interface iface=iphone0 serial=<udid>
2024/03/12 14:20:57 INFO got device serial=<udid>
2024/03/12 14:20:57 INFO active config active=5 serial=<udid>
2024/03/12 14:20:57 INFO available configs configs="map[1:Configuration 1 2:Configuration 2 3:Configuration 3 4:Configuration 4 5:Configuration 5]" len=5 serial=<udid>
2024/03/12 14:20:57 INFO got config config="vid=05ac,pid=12a8,bus=1,addr=94,config=5" serial=<udid>
2024/03/12 14:20:57 INFO alt setting alt="Interface 3 alternate setting 1 (available endpoints: [0x05(5,OUT) 0x86(6,IN)])" class=10 subclass=0 protocol=1 serial=<udid>
2024/03/12 14:20:57 INFO alt setting alt="Interface 5 alternate setting 1 (available endpoints: [0x06(6,OUT) 0x87(7,IN)])" class=10 subclass=0 protocol=1 serial=<udid>
2024/03/12 14:20:57 INFO 0x87
2024/03/12 14:20:57 INFO 0x06
2024/03/12 14:20:57 INFO claimed interfaces serial=<udid>
2024/03/12 14:20:57 INFO created streams serial=<udid>
2024/03/12 14:20:57 INFO creating TAP device device=iphone0 serial=<udid>
2024/03/12 14:20:57 INFO add IP address to device device=iphone0 serial=<udid> ip=FC00:0000:0000:0000:0000:0000:0000:00FB/64
2024/03/12 14:20:57 INFO ethernet device is up: device=iphone0 serial=<udid>

Sometime I see such error in logs (do not know its importance though) 2024/03/12 14:21:17 handle_events: error: libusb: interrupted [code -10]

I tried this on a docker but go-ncm just stops at this 2024/04/26 17:03:44 INFO usbmuxd version version=1.1.2 2024/04/26 17:03:44 INFO prometheus metrics not configured. start with '--prometheusport=8080' to expose prometheus metrics.

then print out bunch of handle_events: error: libusb: interrupted [code -10] Is there anyone having the same issue?

Same isssue in Debian 12: handle_events: error: libusb: interrupted [code -10]

It seems working properly, just annoying messages. My docker environment works fine.