PHPackages                             pkgmcp/adb-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. pkgmcp/adb-php

ActiveLibrary[CLI &amp; Console](/categories/cli)

pkgmcp/adb-php
==============

Pure PHP 8.3 ADB client — full port of @devicefarmer/adbkit v3.3.8

1.0.0(3mo ago)01Apache-2.0PHPPHP &gt;=8.3

Since Apr 26Pushed 3mo agoCompare

[ Source](https://github.com/pkgmcp/adb-php)[ Packagist](https://packagist.org/packages/pkgmcp/adb-php)[ Docs](https://github.com/pkgmcp/adb-php)[ RSS](/packages/pkgmcp-adb-php/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

adb-php
=======

[](#adb-php)

> Pure PHP 8.3 ADB client — full port of [@devicefarmer/adbkit](https://github.com/devicefarmer/adbkit) v3.3.8

[![PHP ≥ 8.3](https://camo.githubusercontent.com/35f84bea2f0d533d925b00c1c13b3af86ee7404e60ac9afaf209d86454af7285/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d253345253344382e332d383839326266)](https://php.net)[![Tests](https://camo.githubusercontent.com/e67404b8e8592facf2cfb61bf6bffd734e78a8fbecf1a08272424a8c81b28891/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f54657374732d39322532306163726f7373253230313725323066696c65732d677265656e)](tests/)[![Coverage](https://camo.githubusercontent.com/02dbe35385539e972123ae8acde8c56737d72f38366a12ad780f5b8a314a3d7f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f436f7665726167652d38342d2d39372532352d627269676874677265656e)](coverage/)[![License: Apache-2.0](https://camo.githubusercontent.com/53aec1ae7394521e2af38df6c1560d97fcb8152f5edd45d87563432eed72bf7a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d417061636865253230322e302d626c7565)](LICENSE)

---

What Is This?
-------------

[](#what-is-this)

**adb-php** is a complete PHP 8.3+ port of `@devicefarmer/adbkit` v3.3.8 — a pure Node.js ADB client. No native extensions, no `exec('adb ...')`. Pure PHP over TCP to the ADB server.

> The ADB **server** must be running (`adb start-server`). adb-php is a client library.

---

Requirements
------------

[](#requirements)

- PHP **8.3+**
- ADB server running (`adb start-server`)
- Zero extensions beyond standard PHP

---

Installation
------------

[](#installation)

```
composer require adb-php/adb-php
```

---

Quick Start
-----------

[](#quick-start)

```
use AdbPhp\AdbClient;

$adb = AdbClient::create();
$devices = $adb->listDevices();
$device = $adb->getDevice($devices[0]->id);

echo $device->shell('uname -a');
$device->install('/path/to/app.apk');
file_put_contents('/tmp/screen.png', $device->screencap());
```

---

Full Feature Map
----------------

[](#full-feature-map)

CategoryMethodsStatus**Server**`create()`, `version()`, `kill()`, `connect()`, `disconnect()`✅**Listing**`listDevices()`, `listDevicesWithPaths()`, `trackDevices()`✅**Info**`getSerialNo()`, `getState()`, `getDevicePath()`✅**Properties**`getProperties()`, `getFeatures()`, `getPackages()`✅**Network**`getDHCPIpAddress()`✅**Shell**`shell(command)`✅**Apps**`install()`, `installRemote()`, `uninstall()`, `isInstalled()`, `clear()`✅**Intents**`startActivity()`, `startService()`✅**Files**`push()`, `pull()`, `stat()`, `readdir()`✅**SYNC**`syncService()` → `SyncService` (9 methods)✅**Forwards**`forward()`, `listForwards()`, `reverse()`, `listReverses()`✅**Transport**`tcpip()`, `usb()`✅**Root**`root()`, `remount()`✅**Reboot**`reboot(mode)`✅**Screen**`screencap()`, `framebuffer()`✅**Logcat**`openLogcat()`, `openLog()`✅**Monkey**`openMonkey()` → `MonkeyClient` (17 methods)✅**Process**`openProcStat()`, `trackJdwp()`✅**Socket**`openTcp()`, `openLocal()`✅**Wait**`waitForDevice()`, `waitBootComplete()`✅**Attach**`attach()`, `detach()`✅**Util**`parsePublicKey()`✅---

Missing Features (Known)
------------------------

[](#missing-features-known)

FeatureStatusReason`DeviceClient` live integration tests🟡 MediumAll methods implemented; tested via mock sockets; live tests need running emulator`SyncService` end-to-end with live device🟡 MediumBinary SYNC protocol fully tested via injected streams; device test needs emulator`LogcatReader` live stream test🟡 MediumBinary frame parsing tested; live stream needs emulator`MonkeyClient` live UI automation🟡 MediumAll 17 methods implemented; needs emulator with Monkey server running`trackDevices()` live event test🟡 LowGenerator yields events from socket; live test needs physical device plug/unplugSuper partition / LP metadata🔴 Not in scopeNot in upstream adbkit either> 📌 All "missing" items are test coverage gaps, not missing functionality. The code is 100% implemented.

---

PHP 8.3 Features
----------------

[](#php-83-features)

FeatureCountExamples`readonly class`8 classesDevice, FileEntry, CpuStats, LogcatEntry, ...`const int` / `string` / `array`30+ constantsPriority levels, ADB status, SYNC commands`#[Override]`22 methodsAll transport implementationsNamed argumentsThroughout`new CpuStats(user: 100, nice: 0, ...)``match` expression1AdbSocket status parsing`never` return type2Error-throwing helpers---

Testing
-------

[](#testing)

```
composer install
./vendor/bin/phpunit --colors=always
```

**92 tests** across 17 files — 92 pass offline with no device.

- Mock socket injection for SyncService, LogcatReader, AdbSocket
- Pre-seeded tmpfile streams for DeviceClient shell/properties
- Real connection refused tests for transports

---

File Structure
--------------

[](#file-structure)

```
adb-php/
├── composer.json
├── README.md
├── CHANGELOG.md
├── SECURITY.md
├── LICENSE
├── phpunit.xml
├── src/
│   ├── AdbClient.php            # ADB server client (10 methods)
│   ├── DeviceClient.php         # Per-device ops (50 methods)
│   ├── SyncService.php          # SYNC protocol (9 methods)
│   ├── Protocol/
│   │   └── AdbSocket.php        # Wire protocol socket
│   ├── Models/                  # 8 readonly classes
│   │   ├── Device.php
│   │   ├── DeviceWithPath.php
│   │   ├── FileEntry.php
│   │   ├── Forward.php
│   │   ├── Reverse.php
│   │   ├── FramebufferMeta.php
│   │   ├── CpuStats.php
│   │   └── StartActivityOptions.php
│   ├── Transfers/
│   │   ├── PushTransfer.php
│   │   └── PullTransfer.php
│   ├── Logcat/
│   │   ├── LogcatEntry.php
│   │   └── LogcatReader.php
│   ├── Monkey/
│   │   └── MonkeyClient.php
│   ├── ProcStat/
│   │   └── ProcStat.php
│   └── Exceptions/
│       ├── AdbException.php
│       ├── ConnectionException.php
│       ├── ProtocolException.php
│       └── DeviceNotFoundException.php
├── tests/Unit/
│   ├── AdbClientTest.php
│   ├── ExceptionsTest.php
│   ├── Integration/
│   │   ├── AdbSocketTest.php
│   │   ├── SyncServiceTest.php
│   │   ├── LogcatReaderTest.php
│   │   ├── DeviceClientTest.php
│   │   └── MonkeyClientTest.php
│   ├── Models/
│   │   ├── DeviceTest.php
│   │   ├── FileEntryTest.php
│   │   ├── CpuStatsTest.php
│   │   └── StartActivityOptionsTest.php
│   ├── Logcat/
│   │   └── LogcatEntryTest.php
│   ├── ProcStat/
│   │   └── ProcStatTest.php
│   └── Transfers/
│       ├── PushTransferTest.php
│       └── PullTransferTest.php
├── examples/                    # 9 scripts
└── docs/
    └── API.md

```

---

Credits
-------

[](#credits)

- Original: [@devicefarmer/adbkit](https://github.com/devicefarmer/adbkit) v3.3.8 — Apache 2.0

---

License
-------

[](#license)

Apache 2.0 — see [LICENSE](LICENSE).

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance82

Actively maintained with recent releases

Popularity1

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

90d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/40be284b8dd88b2d48b0d446df171ae05f8eaaf44ab18b948766c6fafc76f9f4?d=identicon)[shamimstack](/maintainers/shamimstack)

---

Tags

debugshellandroidinstallapkadbadbkitlogcat

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/pkgmcp-adb-php/health.svg)

```
[![Health](https://phpackages.com/badges/pkgmcp-adb-php/health.svg)](https://phpackages.com/packages/pkgmcp-adb-php)
```

###  Alternatives

[psy/psysh

An interactive shell for modern PHP.

9.8k582.3M832](/packages/psy-psysh)[mikehaertl/php-shellcommand

An object oriented interface to shell commands

32540.9M71](/packages/mikehaertl-php-shellcommand)[kevinlebrun/colors.php

Colors for PHP CLI scripts

3427.0M46](/packages/kevinlebrun-colorsphp)[buggregator/trap

A simple and powerful tool for debugging PHP applications.

2702.2M69](/packages/buggregator-trap)[mrrio/shellwrap

Use any command-line tool as a PHP function.

738214.3k2](/packages/mrrio-shellwrap)[alecrabbit/php-console-spinner

Extremely flexible spinner for \[async\] php cli applications

24038.0k2](/packages/alecrabbit-php-console-spinner)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
