node-ios-device icon indicating copy to clipboard operation
node-ios-device copied to clipboard

Feature request: Return devices connected via wifi.

Open jonasfunk opened this issue 10 months ago • 3 comments

Return devices connected via wifi.

From documentation: "Note that only devices connected via a USB cable will be returned. Devices connected via Wi-Fi will not be returned. The main reason we do this is because you can only relay the syslog from USB connected devices. This restriction be lifted in the future."

jonasfunk avatar Sep 29 '23 12:09 jonasfunk

node-ios-device@3 supports this! :)

There are limitations though. We can't port forward over WiFi which means we can't see logs. Installing apps works though.

cb1kenobi avatar Sep 29 '23 13:09 cb1kenobi

Sounds nice 👏. Personally I would be ok with this, as long as you are informed that there is a limitation with logs. Is it an easy fix to make it work?

jonasfunk avatar Sep 29 '23 15:09 jonasfunk

The readme makes mention of the limitation with the forward() API. I should point out this port forwarding is for general use, but was designed for debug logging exclusively used by Titanium apps.

If I recall correctly, back in the day, iOS would let apps write to syslog and that's how logging worked in Titanium apps. iOS had a syslog relay service that node-ios-device would use. Then iOS switched how app logging worked and app logging was no longer written to syslog. I wrote a debug log server that ran in the background of a Titanium app for the Titanium CLI can connect to and get log messages. It created a real socket listening on a real port. That's where the port forwarding came in.

I would still categorize this as a limitation of the forward() API. Apps and libraries that use node-ios-device would likely detect if the device is USB or WiFi, then if USB, use forward(). If WiFi, get somehow get the device's IP address and directly connect to it over WiFi.

cb1kenobi avatar Sep 29 '23 16:09 cb1kenobi