Skip to content

Allow setting localHostAddress for android-livesync-tool #5302

Open
@rigor789

Description

@rigor789

Is your feature request related to a problem? Please describe.

A little bit of background why I ran into this issue: I'm running an emulator on a separate PC and connect to it over the network. (this is different from adb tcpip). This all works fine with adb, and the initial app install, but the address defaults to 127.0.0.1 and livesync is not able to restart the app on the remote emulator. If I manually patch the address in my CLI, it works as expected.

The android-livesync-tool has a configuration option for localHostAddress but it can't be changed from the CLI.

The tool is called from here:

await this.livesyncTool.connect({
appIdentifier,
deviceIdentifier: this.device.deviceInfo.identifier,
appPlatformsPath: projectFilesPath,
connectTimeout
});

And localHostAddress is never passed, so it always defaults to DEFAULT_LOCAL_HOST_ADDRESS here:

if (!configuration.localHostAddress) {
configuration.localHostAddress = DEFAULT_LOCAL_HOST_ADDRESS;
}

Describe the solution you'd like

I would like to be able to specify the address somehow. A cli argument, a setting in nsconfig.json or even just an env variable would be enough for me. Perhaps read ANDROID_ADB_SERVER_ADDRESS as that is where adb can get the address for a remote adb server.

Describe alternatives you've considered

N/A

Additional context

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions