autoadb
autoadb copied to clipboard
Needs some (or better) documentation
Instructions are assuming many things:
- user has rustup installed
- user knows how to install rustup
- user knows how to use the binary file once it's built (I get
command not found : autoadb
when I try to run it)
It would also be nice to know how to use autoadb and also how to configure it away from the 3 examples given:
For example, to execute printf on device connection:
autoadb printf 'Device connected\n'
{} replaces the serial of the device detected:
autoadb printf 'Device %s connected\n' '{}'
It may be used to start scrcpy:
autoadb scrcpy -s '{}'
Questions:
- Is this supposed to run in the shell and keep a window help up while it is monitoring?
- What's the syntax for usage as I don't run
scrcpy
I runscrcpy --bit-rate 2M --max-size 800 -w --max-fps 15 --lock-video-orientation 0 --always-on-top -S --shortcut-mod=lalt,ralt
is itautoadb <command to run> <options to run on the command> <autoadb options> or is it
autoadb - What are the other options other than -s?
I'm not the developer of this, but answering based on a quick look through the source:
-
Yes, keep a terminal window open with the running command, it will run the command whenever a new device is detected
-
& 3. It's really very simple - you run
autoadb XXXX
where XXXX is any command you want to run for every new device. The only customisation that you're given is that any of the arguments equal to a string{}
will be substituted for the connected device's serial. There are no command line options. The-s
you see in the examples is an option for scrcpy, autoadb doesn't understand it or do anything with it, it just passes it further.
Example of how I used it myself:
autoadb adb reverse tcp:3000 tcp:3000
- runs adb reverse tcp:3000 tcp:3000
on a device connection (will only work if you have at most one device, and not even because I don't pass the serial anywhere - it'd try to use the same port twice. and fail)
Overall it's extremely basic in the current form, with no options etc (only the serial substitution), but I still found it useful for the above case, so thanks to the author for your work!
And see if there's a package to install this for your OS - for example for Arch Linux there's autoadb-git in AUR. Simplifies the install a bit.