Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for ADB_SERVER_SOCKET in dumpapp #623

Merged
merged 1 commit into from
Oct 10, 2018

Conversation

asm89
Copy link
Member

@asm89 asm89 commented Oct 9, 2018

There are multiple ways to set the adb server connection information in the
environment. This commit adds support for ADB_SERVER_SOCKET.

Set a valid server socket environment variable:

$ export ADB_SERVER_SOCKET=tcp:localhost:5038
$ adb devices
List of devices attached
* daemon not running; starting now at tcp:localhost:5038
* daemon started successfully

Now dumpapp doesn't fail anymore:

$ scripts/dumpapp
Failure to target device None: no devices/emulators found

It does fail when the socket spec is invalid/unsupported:

$ export ADB_SERVER_SOCKET=nope
$ scripts/dumpapp
...
stetho_open.HumanReadableError: Invalid or unsupported socket spec 'nope' specified in ADB_SERVER_SOCKET.
$ export ADB_SERVER_SOCKET=tcp:localhost:abc
$ scripts/dumpapp
...
stetho_open.HumanReadableError: Invalid integer 'abc' specified in ANDROID_ADB_SERVER_PORT or ADB_SERVER_SOCKET.

Verified

This commit was signed with the committer’s verified signature. The key has expired.
dtzWill Will Dietz
There are multiple ways to set the adb server connection information in the
environment. This commit adds support for `ADB_SERVER_SOCKET`.

Set a valid server socket environment variable:
```
$ export ADB_SERVER_SOCKET=tcp:localhost:5038
$ adb devices
List of devices attached
* daemon not running; starting now at tcp:localhost:5038
* daemon started successfully
```

Now dumpapp doesn't fail anymore:
```
$ scripts/dumpapp
Failure to target device None: no devices/emulators found
```

It does fail when the socket spec is invalid/unsupported:
```
$ export ADB_SERVER_SOCKET=nope
$ scripts/dumpapp
...
stetho_open.HumanReadableError: Invalid or unsupported socket spec 'nope' specified in ADB_SERVER_SOCKET.
```

```
$ export ADB_SERVER_SOCKET=tcp:localhost:abc
$ scripts/dumpapp
...
stetho_open.HumanReadableError: Invalid integer 'abc' specified in ANDROID_ADB_SERVER_PORT or ADB_SERVER_SOCKET.
```
@jasta jasta merged commit 81bd246 into facebook:master Oct 10, 2018
@jasta
Copy link
Contributor

jasta commented Oct 10, 2018

Great work, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants