I'm trying to find a way to use the developer tools in one of the Android browsers, e.g. Chrome and Firefox. They appear to not be shipped with the builds, to avoid cluttering them with functionality used by less than 1% of users I guess.
My context: I'm now using my Android phone as a functional development environment, using Termux and Vim on one of the recent desktop Android interfaces (+ a keyboard and desktop monitor). However, I cannot do Web development locally as it requires using browser dev tools (at least the console, inspector and debugger). Firefox and Chrome's remote debugging won't do, as the point is precisely to avoid carying a laptop.
Given that they are now standalone HTML / React apps (chrome and firefox),
how hard would it be to build a "developer version" of these browsers, available in the play store?
would it be possible to integrate them as a Web extension (for Firefox at least, since Chrome for Android deactivates them)?
Alternatively, since both browsers can be debugged remotely, this means that they expose an API. Both browsers communicate with the host via a unix socket.
I can see that they are running (cat /proc/net/unix | grep devtool), but I can't manage to forward it to localhost:9222, which is what the chrome dev tools frontend needs.
What should be reproduced on the Android device itself is that simple command :
adb -s <device> forward tcp:9222 localabstract:@chrome_devtools_remote
.
What I naively tried is : socat -d tcp-listen:9222,fork abstract-connect:chrome_devtools_remote
.
Unfortunately, it's not working: "connection reset by peer". Am I missing some kind of translation step from the Unix socket to something understandable by the JS dev tools frontend?
adb
withchrome://inspect
...instead of adding lots of useless complexity. – Debus