Skip to content

An embeddable reimplementation of the ADB CLI

Notifications You must be signed in to change notification settings

ssttevee/libadb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

libadb

This is an attempt to reimplement the host (and maybe client) side of the Android Debug Bridge such that it may embedded into other programs and be used independently of the official ADB binary. Please see protocol.md for more information about the protocol.

There is currently no actual library or header emitted while the implementation is confirmed to work on a wide range of devices, but it can be imported from other zig programs.

Building

zig build --release=safe

Importing from another zig project

Run this command from your project folder

zig fetch --save https://github.com/ssttevee/libadb/archive/refs/heads/trunk.tar.gz

Then add this snippet to your build.zig file

const adb = b.dependency("adb", .{
    .optimize = optimize,
    .target = target,
});

exe.root_module.addImport("adb", adb.module("adb"));

Examples

There is currently only one example that simulates running adb exec-out screencap -p.

./zig-out/bin/example_screencap > screencap.png

Additional notes

  • Openssl is currently required. This dependency will likely be removed as soon as the necessary RSA and TLS operations are shipped in the zig std library.

  • The TCP transport implementation is not currently working due to what seems to be an issue with the zig std library tls client.

  • This library currently only supports single-threaded and single-socket operation. This will most likely only be addressed after ziglang/zig#6025 is fixed.

About

An embeddable reimplementation of the ADB CLI

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Languages