rom1v / autoadb Goto Github PK
View Code? Open in Web Editor NEWExecute a command whenever a device is adb-connected
Execute a command whenever a device is adb-connected
Hi.
I compiled the latest version of this repo using cargo
on macOS Catalina.
I have two devices: An AVD (Emulator) and a physical Android device (Samsung Galaxy J5 (2017) w/ Android 9.0).
When I start autoadb with scrcpy as you mentioned, the emulator shows up, but the phone doesn't. Showing this error:
Deteted device 5200b231bc27549d
2020-05-31 23:56:48.742 scrcpy[54954:174355] INFO: scrcpy 1.12.1 <https://github.com/Genymobile/scrcpy>
/usr/local/Cellar/scrcpy/1.12.1/share/...shed. 3.2 MB/s (26202 bytes in 0.008s)
bind: Address already in use
This is very common and I usually fix it by killing adb.
When I unplug it and plug it again, it shows the following message:
Deteted device 5200b231bc27549d
dyld: Library not loaded: /usr/local/opt/libffi/lib/libffi.6.dylib
Referenced from: /usr/local/opt/p11-kit/lib/libp11-kit.0.dylib
Reason: image not found
Any explanations, fixes, or workarounds?
(btw, I kept your typo 'deteted'. Consider merging my pull request)
I have trouble automatically start autoadb. I know that the error is possibly in my systemd config, but all the error messages come from autoadb, and I hope that you could explain what the error messages exactly mean, to diagnose the issue.
zoltan@aprosag ~/.config/systemd/user $ systemctl --user status autoadb
● autoadb.service - autoadb
Loaded: loaded (/home/zoltan/.config/systemd/user/autoadb.service; disabled; vendor preset: enabled)
Active: active (running) since Wed 2020-09-02 17:19:49 CEST; 4min 52s ago
Main PID: 6427 (autoadb)
CGroup: /user.slice/user-1000.slice/[email protected]/autoadb.service
└─6427 /home/zoltan/git_repos/autoadb/target/release/autoadb scrcpy -s {}
Sep 02 17:19:49 aprosag systemd[2360]: Started autoadb.
Sep 02 17:19:49 aprosag autoadb[6427]: Detected device 73QDU17107002001
Sep 02 17:19:49 aprosag autoadb[6427]: INFO: scrcpy 1.16 <https://github.com/Genymobile/scrcpy>
**Sep 02 17:19:49 aprosag autoadb[6427]: exec: No such file or directory**
Sep 02 17:19:49 aprosag autoadb[6427]: ERROR: Command not found: [/usr/bin/adb], [-s], [73QDU17107002001], [push], [/usr/local/share/scrcpy/scrcpy-server], [/data/local/tmp/scrcpy-server.jar]
Sep 02 17:19:49 aprosag autoadb[6427]: ERROR: (make 'adb' accessible from your PATH or define its fullpath in the ADB environment variable)
Sep 02 17:19:49 aprosag autoadb[6427]: INFO: You may download and install 'adb' from https://developer.android.com/studio/releases/platform-tools
Sep 02 17:19:49 aprosag autoadb[6427]: ERROR: Could not execute "adb push"
zoltan@aprosag ~/.config/systemd/user $ adb --version
Android Debug Bridge version 1.0.39
Version 1:8.1.0+r23-5~18.04
Installed as /usr/lib/android-sdk/platform-tools/adb
zoltan@aprosag ~/.config/systemd/user $ /usr/bin/adb --version
Android Debug Bridge version 1.0.39
Version 1:8.1.0+r23-5~18.04
Installed as /usr/lib/android-sdk/platform-tools/adb
zoltan@aprosag ~/.config/systemd/user $ cat autoadb.service
[Unit]
Description=autoadb
[Service]
Type=simple
Environment=ADB="/usr/bin/adb"
ExecStart=/home/zoltan/git_repos/autoadb/target/release/autoadb scrcpy -s '{}'
[Install]
WantedBy=default.target
What is strange to me, that there is no /usr/local/share/scrcpy/scrcpy-server
file in my system.
zoltan@aprosag ~/.config/systemd/user $ ll /usr/local/share/scrcpy/scrcpy-server
ls: cannot access '/usr/local/share/scrcpy/scrcpy-server': No such file or directory
Starting autoadb from the command line works.
Could you help me pin-pointing what is the issue? autoadb detects the ID of the device, isn't it done with adb? Is the error clearly 'just' that the systemd unit does not find the command even with absolute path?
hi
h
When there are two devices in my adb devices
for example:
$ : adb adb devices
List of devices attached
192.168.43.10:5555 device
192.168.43.234:5555 device
I use autoadb scrcpy -s 192.168.43.10:5555
This opens two 192.168.43.10:5555
connection windows repeatedly.
Is this expected behavior or is there a problem?
Is it possible?
how to use autoadb?? newbie here
i need to install autoadb but when i use this command on cargo build --release directory is says
'cargo' is not recognized as an internal or external command,
operable program or batch file.
and
even adb is connected
it says
adb.exe: unknown command cargo
please help me
Big ups @rom1v for autoadb and scrcpy. I've been getting RSI from holding my phone too much swiping on the tinders and now I can control it remotely when at my desk all day haha jokes to the tinder part ;). Thank you!!
Now, to business. Here's how to launch autoadb and scrcpy @ system boot and hidden to system tray to lessen the clutter of autoadb always running in taskbar.
#NoTrayIcon
#Persistent
global hAutoadb
/* Setup Tray icon and add item that will handle
* double click events
*/
Menu Tray, Icon
Menu Tray, Icon, android.ico
Menu Tray, Add, Show / Hide autoadb, TrayClick
Menu Tray, Default, Show / Hide autoadb
;// Run autoadb hidden
DetectHiddenWindows On
Run autoadb.exe scrcpy.exe --always-on-top --turn-screen-off --stay-awake --show-touches,, Hide, PID
WinWait ahk_pid %PID%
hAutoadb := WinExist()
DetectHiddenWindows Off
return
TrayClick:
OnTrayClick()
return
;// Show / hide Autoadb on double click
OnTrayClick() {
if DllCall("IsWindowVisible", "Ptr", hAutoadb) {
WinHide ahk_id %hAutoadb%
} else {
WinShow ahk_id %hAutoadb%
WinActivate ahk_id %hAutoadb%
}
}
Scrcpy work fine when started manually, but with autoadb scrcpy -sW '{}' I get :
Detected device b73e81b9 ERROR: Unexpected additional argument: b73e81b9
i have debain system
I'm using scrcpy and i found this tool to make device connecting automatic
i follow all steps but when reach to this path ~/.cargo/config not found Config file so i make one I'm not sure is it the right way ?
and after finish everything what i shall i do ?
Hello,
I try to install autoadb but command cargo build --release
failed with:
warning: unused manifest key: package.edition
Compiling byteorder v1.3.2
Compiling log v0.4.8
error: non-ident macro paths are experimental (see issue #35896)
--> /home/<user>/.cargo/registry/src/github.com-1ecc6299db9ec823/log-0.4.8/src/lib.rs:1422:1
|
1422 | / cfg_if! {
1423 | | if #[cfg(all(not(debug_assertions), feature = "release_max_level_off"))] {
1424 | | const MAX_LEVEL_INNER: LevelFilter = LevelFilter::Off;
1425 | | } else if #[cfg(all(not(debug_assertions), feature = "release_max_level_error"))] {
... |
1447 | | }
1448 | | }
| |_^
|
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
error: aborting due to previous error
error: Could not compile `log`.
warning: build failed, waiting for other jobs to finish...
error: build failed
Hello there!
I'm a newbie and want to use this AutoADB tool with scrcpy but when I triy to install AutoADB I got some problems.
So I installed this rust environment that I downloaded from here: https://www.rust-lang.org/tools/install. After that, I downloaded the AutoADB project and extracted its files from the archive. Then I opened the folder and then ran Windows PowerShell there and put this command: cargo build --release
But after entered that command it showed me some errors:
What do I need to do?
When i run this command
autoadb scrcpy -s '{ }'
answer:
bash: autoadb: command not found
I already install rust enviroment from https://www.rust-lang.org/tools/install
and type this command
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
and successfully install
i type cargo --version display below
cargo 1.61.0 (a028ae4 2022-04-29)
then download autoadb-master.zip
extract zip
and type comman below in folder which extract by zip autoadb-master.zip
cargo build --release
and it generated the binary in target/release/autoadb
Did i miss something in the process?
Hi
Is there a way to run autoadb.exe without the console opening?
I have autoaudb set as a startup process and set to run scrcpy-noconsole.exe when I plug in my phone. That works great, but of course I still end up stuck with the console window open from autoadb running.
Is there any way to just run it in the background, without the console having to stay open, or can you release a noconsole.exe version like you did with scrcpy?
Thank You,
Zeagar
This program works perfectly when the device is connected, but how to use the same one to execute a task when the device is disconnected?
Instructions are assuming many things:
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:
scrcpy
I run scrcpy --bit-rate 2M --max-size 800 -w --max-fps 15 --lock-video-orientation 0 --always-on-top -S --shortcut-mod=lalt,ralt
autoadb <command to run> <options to run on the command> <autoadb options> or is it
autoadb Is it possible to put compiled windows autoadb here?
Thanx
Is there any configuration options to issue a command only for a predefined (set of) device(s)? Like a config file in ~/.autoadb/?
I would like to use scrcpy with it, but I would like to connect only to my own phone, and not other devices or someone's else phone, which is connected only for charging.
I know that most people does not have the developers options enabled in their phone, and probably any other device also won't react to adb or scrcpy, but I don't want to accidentally interact with another device.
Also for different devices, there could be different commands to execute.
When typing autoadb printf 'Device connected\n' it just hangs with no output. Same for the rest of the commands. What am I doing wrong. Cheers
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.