Marius Gavrilescu


Android::ADB - thin wrapper over the 'adb' command


  use Android::ADB;;
  my $adb = Android::ADB->new(path => '/opt/android/platform-tools/adb');
  my @devices = $adb->devices;
  $adb->push('file.txt', '/sdcard/');
  sleep 10;


This module is a minimal wrapper over the Android Debug Bridge (adb) command for manipulating Android devices.

Methods die on non-zero exit code and return the text printed by the adb command. The available methods are:


Create a new Android::ADB object. The available arguments are path, the path to the adb executable (defaults to the value of the environment variable ADB or the string adb) and args, an arrayref of arguments passed to every adb command (defaults to []).


Returns a list of Android::ADB::Device objects representing connected devices.


Takes an Android::ADB::Device and directs all further commands to that device by passing -s serialno to every command.

$adb->run($command, [@args])

Run an arbitrary ADB command and return its output.

$adb->push($local, $remote)
$adb->pull($remote, $local)

Analogues of the respective adb commands.

$adb->pull_archive($remote, $local)

Same as adb pull -a $remote $local.


Marius Gavrilescu, <>


Copyright (C) 2017 by Marius Gavrilescu

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.24.2 or, at your option, any later version of Perl 5 you may have available.