by Giacomo Furlan [email protected]
ADTlib is a C# / .NET 4.5 library which aims to help the developer to use the Android development tools (adb, fastboot etc) inside a .net project / solution.
It wraps the original executables and executes them, interpreting the output and returning feedback, or the output itself if desired.
This software is currently in development.
- ✔ Resources copy (executables and relative libraries) & basic execution from
%AppData%
- ✔ Basic ADB commands
- ✔ Get the devices' list (see
Device
) - ✔ Execute a generic command with parameters (with or without returning output)
- ✔ Push a file to the device
- ✔ Pull a file from the device
- ✔ Delete a file from the device
- ✔ Execute a shell command
- ✔ Install an application from an APK hosted on the computer
- ✔ Uninstall an application
- ✔ Do a backup
- ✔ Do a restore from a previous backup
- ✔ Reboot
- ✔ Get the devices' list (see
- Advanced ADB commands
- ✔ Wait for any device, or a specific one
- ✔ Start and kill the adb server
- ✔ (Re)start the adb server as root
- ✔ Remount the /system partition in read/write
- Switch between ADB TCP and USB mode
- Basic Fastboot commands (TBA)
- Advanced Fastboot commands (TBA)
- Device
- ✔ Read the build.prop file and get any of its properties
- ✔ Read the device's state on the fly
- ✔ Read the device's serial number
Simply import the ADTlib project (not solution) in your solution, or build it and import / reference the dll directly. The Tests
project is not built in the release mode in any case.
It is designed so that you should only need to get the instance of Adb
via Adb.Instance
and use its methods. Once completed, there will be the Fastboot
class, with the same usage. Each method has its own summary.
You may though want to know what the various classes do:
Adb
: an interface for adb.exe. It's a singleton.Build
: the build.prop reader.Device
: the device's model. Contains the serial number, the build.prop instance (Build class) and the state of the device.Utils\Exe
: a utility class to easily execute adb/fastboot commands.Utils\ResourcesManager
: a utility class to automatically extract adb, fastboot and their DLLs to an %AppData% subfolder; to retrieve their location (execution path). It's a singleton.Extensions.cs
file: some useful string extensions for the ADB arguments.
0.8.0.0
- Start and kill the ADB server
- Start the ADB server as root for a particular device
- Remount the system partition as read/write
0.7.0.0
- Added Adb.WaitForDevice
- Implemented timeout in Exe.Run
- Renamed ExeResult's StdOutput and StdError in Output and Error
0.6.0.0
- Added Adb.Reboot
- Now all the void Adb methods return ExeResult, an object containing the exit code and the output and error in the form of strings.
- Tweaked some code styling
- Removed unnecessary NoParametric methods
0.5.0.0
- Added Adb.Backup
- Added Adb.Restore
- Added a (still unused) string extension to wait for a file lock
0.4.5.0
- Modified non-parametrical method names (from *NoParams to *NoParametric)
- Added Adb.Uninstall
0.4.0.0
- Created non-parametrical method aliases for low-level commands
- Added Adb.Install
0.3.0.0
- Using parametrical arguments
- Added Adb.Shell
0.2.0.0
- The state of the device is being read dynamically executing
adb get-state
0.1.0.0
- Initial commit