[remote-dbg] Allow using system-wide/custom ADB binary (at least for unsupported platforms)
Categories
(DevTools :: about:debugging, enhancement, P3)
Tracking
(Not tracked)
People
(Reporter: val, Unassigned)
Details
Currently the USB debugging functionality only uses adb binaries bundled in a special extension and therefore works only on a limited set of platforms.
To quickly get to using USB debugging on FreeBSD I've had to manually override stuff in the source:
--- i/devtools/client/shared/remote-debugging/adb/adb-binary.js
+++ w/devtools/client/shared/remote-debugging/adb/adb-binary.js
@@ -238,6 +238,8 @@ async function isUnpacked() {
* File object for the binary.
*/
async function getFileForBinary() {
+ return new FileUtils.File('/usr/local/bin/adb');
+
if (!(await isUnpacked()) && !(await extractFiles())) {
return null;
}
--- i/devtools/client/shared/remote-debugging/adb/adb.js
+++ w/devtools/client/shared/remote-debugging/adb/adb.js
@@ -126,7 +126,7 @@ class Adb extends EventEmitter {
}
_shouldTrack() {
- return adbAddon.status === "installed" && this._listeners.size > 0;
+ return /*adbAddon.status === "installed" &&*/ this._listeners.size > 0;
}
/**
(and my Android phone has been found and usable even though the status of USB debugging was still displayed as "disabled")
It would be nice if there was proper support for this. Automatically picking up adb on $PATH on unsupported platforms and/or allowing the user to specify a custom path in about:config (or right on about:debugging with a "Select custom ADB binary" button)… or something.
This effects linux distros which aren't using glibc too (eg. Alpine Linux) since the adb binaries are linked against glibc.
I noticed that firefox will connect to a system provided adb server when it is started before opening about:debugging. Unfortunately firefox still blocks using adb when the extension is not installed. Ideally the "Refresh devices" button would try to connect to an adb server even when firefox isn't aware of any installed version of adb (eg. when using containerization).
Updated•11 months ago
|
Description
•