Skip to content

Commit

Permalink
Merge pull request #1222 from doronz88/feature/usbmux-envvar
Browse files Browse the repository at this point in the history
cli_common: add `PYMOBILEDEVICE3_USBMUX` envvar
  • Loading branch information
doronz88 authored Oct 2, 2024
2 parents 00deaab + 45e5e91 commit bef4d8a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pymobiledevice3/cli/cli_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,15 @@
from pymobiledevice3.tunneld import TUNNELD_DEFAULT_ADDRESS, async_get_tunneld_devices
from pymobiledevice3.usbmux import select_devices_by_connection_type

USBMUX_OPTION_HELP = 'usbmuxd listener address (in the form of either /path/to/unix/socket OR HOST:PORT'
COLORED_OUTPUT = True
UDID_ENV_VAR = 'PYMOBILEDEVICE3_UDID'
TUNNEL_ENV_VAR = 'PYMOBILEDEVICE3_TUNNEL'
USBMUX_ENV_VAR = 'PYMOBILEDEVICE3_USBMUX'
OSUTILS = get_os_utils()

USBMUX_OPTION_HELP = (f'usbmuxd listener address (in the form of either /path/to/unix/socket OR HOST:PORT). '
f'Can be specified via {USBMUX_ENV_VAR} envvar')


class RSDOption(Option):
def __init__(self, *args, **kwargs):
Expand Down Expand Up @@ -179,7 +182,7 @@ def __init__(self, *args, **kwargs):
self.usbmux_address = None
self.params[:0] = [
click.Option(('usbmux', '--usbmux'), callback=self.usbmux, expose_value=False,
help=USBMUX_OPTION_HELP),
envvar=USBMUX_ENV_VAR, help=USBMUX_OPTION_HELP),
click.Option(('lockdown_service_provider', '--udid'), envvar=UDID_ENV_VAR, callback=self.udid,
help=f'Device unique identifier. You may pass {UDID_ENV_VAR} environment variable to pass this'
f' option as well'),
Expand Down

0 comments on commit bef4d8a

Please sign in to comment.