每当设备通过 adb 连接时,执行一条命令
此命令行工具允许在新设备连接时执行命令。
已连接到 adb。
例如,要在设备连接上执行 printf:
autoadb printf 'Device connected\n'{} 替换检测到的设备的 serial:
autoadb printf 'Device %s connected\n' '{}'它可用于启动 scrcpy:
autoadb scrcpy -s '{}'cargo build --release它会在 target/release/autoadb 中生成二进制文件。
要从 Linux 上构建 autoadb.exe,请安装跨平台编译工具链(在
Debian):
sudo apt install gcc-mingw-w64-x86-64
rustup target 添加 x86_64-pc-windows-gnu
将以下行添加到 ~/.cargo/config:
linker = "x86_64-w64-mingw32-gcc"
ar = "x86_64-w64-mingw32-gcc-ar"
然后执行以下命令:
cargo build --release --target=x86_64-pc-windows-gnu除非适用法律要求或另有书面协议,根据许可证分发的软件以"按现状"的方式分发,不附带任何明示或默示的保证或条件。请参阅许可证,了解许可证规定的权利和限制的具体语言。
[target.x86_64-pc-windows-gnu] [gnirehtet]: https://github.com/Genymobile/gnirehtet
暂无开放 Issues,或尚未同步最近议题。