Web developer tools on Android
Asked Answered
I

1

11

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?

Isoprene answered 4/3, 2018 at 13:50 Comment(1)
use adb with chrome://inspect...instead of adding lots of useless complexity.Debus
L
0

Kiwi browser for Android supports dev tools and extensions.

There is also an Android Firefox version for developers, but the only dev features that I could find were the dark background and the URL bar at the bottom, so you can feel like Trinity entering nmap commands in a terminal when you are doing a google search. Of course, you cannot open a local html file, that would be way too dangerous, even for a developer.

Lemire answered 31/5 at 2:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.