fdroidcl icon indicating copy to clipboard operation
fdroidcl copied to clipboard

fdroidcl on MSYS2/Windows 10: could not get devices: failed to get device ABIs

Open sdbbs opened this issue 3 years ago • 1 comments

Thanks for this awesome software, which I've used without a problem on Linux!

This time, I use MSYS2 bash shell on Windows 10; I have installed go as per https://stackoverflow.com/questions/37198369/use-go-lang-with-msys2 ; and then installed fdroidcl via go get -u mvdan.cc/fdroidcl, seemingly without problems.

Here is what I get with usual adb, with a rooted Samsung XCover2 connected via USB:

$ which adb
/c/bin/platform-tools_r28.0.1/adb

$ adb devices -l
List of devices attached
5205a3bd531d2112       device transport_id:1

$ adb shell "cat /system/build.prop" | grep -i abi
ro.product.cpu.abi=armeabi-v7a
ro.product.cpu.abi2=armeabi

$ adb shell getprop | grep -i abi
[ro.product.cpu.abi2]: [armeabi]
[ro.product.cpu.abi]: [armeabi-v7a]

But, if I try via fdroidcl, I get this:

$ fdroidcl devices
devices: could not get devices: failed to get device ABIs

While I don't know go, I can see in https://github.com/mvdan/fdroidcl/blob/bda1806/adb/device.go that fdroidcl should likely call the system adb that is available, via cmd := exec.Command("adb", "devices", "-l") - so my guess is, that for some reason, it cannot find the path to adb from the MSYS2 shell (however, I also have the same path to adb in Windows PATH, so I can use the same adb in cmd.exe).

So, my questions are:

  • Is there some sort of a verbose mode, so I can track down what actually fails when I run fdroidcl devices?
  • Is there a way to specify an absolute path for the call to adb - maybe via some environment variable?
  • Is there anything else I can try, so I can get fdroidcl working on this platform?

sdbbs avatar Nov 15 '20 16:11 sdbbs

Thanks for the detailed report. It's failing at getAbis, so this has nothing to do with adb not being found.

Perhaps the regular expression to extract properties from adb shell getprop isn't working on Windows because of the different newlines; see var propLineRegex = regexp.MustCompile(`^\[(.*)\]: \[(.*)\]$`). You could try playing with that code or adding debug prints and rebuilding.

I don't have a Windows machine, so I can't help you.

mvdan avatar Nov 15 '20 19:11 mvdan

Does it work now with https://github.com/mvdan/fdroidcl/releases/tag/v0.6.0?

Linus789 avatar Jan 12 '23 22:01 Linus789

I think it should now work with v0.7.0.

Linus789 avatar Mar 01 '23 01:03 Linus789