dtmilano / AndroidViewClient

Android ViewServer and ADB client
Apache License 2.0
1.61k stars 344 forks source link

Add parameters to set the ADB server socket via viewclient.connectToDeviceOrExit() #289

Closed j-jorge closed 3 years ago

j-jorge commented 3 years ago

The host and port were previously the default ones computed in adbclient by reading the ANDROID_ADB_SERVER_HOST and ANDROID_ADB_SERVER_PORT environment variables. Client code could customize the connection by setting the connect() function via the eponymous argument but then the AdbClient.hostname and AdbClient.port properties would be out of sync.

So the only way to use another host/post was to have the environment variables defined, which meant to set os.environ before importing the ViewClient package when these values must be set programmatically.