question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

StartAdbInteractor with default values doesn't work on Windows

See original GitHub issue

Describe the bug Running StartAdbInteractor().execute() never successfully starts an adb server on Windows, because the code explicitly searches for a file named adb in the Android home, but on Windows it’s called adb.exe.

To Reproduce Simply run StartAdbInteractor().execute() (with default values) on Windows, the result is always false.

Expected behavior

It would be great that the default adb binary path was OS-dependent and was adb.exe on Windows instead of adb, so it would work as smoothly as on other OS’es. An even simpler option would be to fallback to a ProcessBuilder with just adb as command name (not a full path), because on my machine adb is on the PATH, so the filename doesn’t matter.

Workaround

The following works fine:

    val androidHome = System.getenv("ANDROID_HOME")?.ifBlank { null }
    val adbBinary = androidHome?.let { Paths.get(androidHome, "platform-tools", "adb.exe")}
    val adbServerStarted = StartAdbInteractor().execute(adbBinary = adbBinary?.toFile())
    if (!adbServerStarted) {
        error("No adb server running")
    }

Android device (please complete the following information):

  • Device: [e.g. Nexus 5] irrelevant
  • OS: [e.g. Android 8.1 official] irrelevant
  • Adam Version: 0.2.5
  • Android Debug Server Version [e.g. 41]: Android Debug Bridge version 1.0.41, Version 31.0.2-7242960

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Malinskiycommented, Jun 4, 2021

@joffrey-bion released in 0.3.1

1reaction
Malinskiycommented, May 26, 2021

Since I don’t have an environment to verify this change I’ll await your reply. Thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot Start menu errors - Windows Client
The following list provides information about common errors you might run into with Start Menu, as well as steps to help you mitigate...
Read more >
sc.exe config - Microsoft Learn
It doesn't share an executable file with other services. This is the default value. share - Specifies a service that runs as a...
Read more >
sc.exe create - Microsoft Learn
It doesn't share an executable file with other services. This is the default value. share - Specifies a service that runs as a...
Read more >
Take control of your Windows start-up - Microsoft Support
In both cases, the most common place to look for startup settings is under the \Software\Microsoft\Windows\CurrentVersion\ folder (or key), where you'll find ...
Read more >
Interactive logon Machine inactivity limit (Windows 10)
The following table lists the actual and effective default values for this policy. Default values are also listed on the policy's property page....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found