stf
stf copied to clipboard
provide for iOS remove debug socat command
we are going to share usbmuxd from device container outside (still TBD if we use proxy service or direct sharing after login) so this command should be displayed in Remote debug field.
socat UNIX-LISTEN:/var/run/usbmuxd,fork,reuseaddr,mode=777 TCP:host:port
interesting roject to share usbmuxd outside: https://github.com/corellium/usbfluxd in case if socat is not so stable
confirmed that socat can connect and reuse iOS device remotely but in scope of the ticket we need secured proxy using dynamic ports to start during device usage and stop after to avoid all kind of unexpected control at runtime
https://github.com/DeviceFarmer/stf_ios_support/commit/a764970091335e16848440a682581a1ab9c54ed9
-
we have port range for every iOS device: declare -x STF_PROVIDER_MIN_PORT="7434" declare -x STF_PROVIDER_MAX_PORT="7440"
-
some of them already used so proxy should be started using any free port from this range. In reality for iOS 7434 is busy and next one is available
-
that's how this data is updated for Android: https://github.com/zebrunner/stf/blob/84703f0764eca8011ede0a2ae5569225e861db27/lib/units/device/plugins/remotedebug.js#L15
-
that's how proxying is organized via db client: https://github.com/zebrunner/stf/blob/84703f0764eca8011ede0a2ae5569225e861db27/lib/units/device/support/adb.js#L11
-
as of now let's put into the field as a hostname value from
--hostcli arg and as a port value from env varSTF_PROVIDER_MIN_PORT + 1
To summarize:
- Everytime we open ios device in stf we have to start socat listen on the dynamic port in between range. It should refer onto the usbmuxd websocket
- Stf should use stf_provider_hostname and this port to show socat connect command to be able to “connect” to device remotely
- Socat command should be stopped on stop using asap to avoid usage of the device outside of the control
above approach ideally applies on Linux agent where every device fully isolated and has it’s own usbmuxd. TBD what we should do for the mac because it will share all devices for this agent server…