Skip to content
This repository was archived by the owner on Sep 2, 2020. It is now read-only.

facebookarchive/fb-adb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

a83d84d · Jun 3, 2019
Oct 18, 2015
Oct 18, 2015
Oct 18, 2015
Oct 18, 2015
Oct 18, 2015
Sep 3, 2015
Dec 1, 2016
Dec 1, 2016
Mar 27, 2019
Mar 27, 2019
Aug 12, 2014
Mar 15, 2017
Mar 15, 2017
Mar 15, 2017
May 22, 2015
Nov 12, 2015
May 22, 2015
May 9, 2015
Jun 3, 2019
Feb 3, 2016
Feb 3, 2016
Mar 15, 2017
Mar 15, 2017
May 14, 2016
Sep 12, 2015
Sep 12, 2015
May 13, 2014
Sep 12, 2015
Sep 12, 2015
Sep 3, 2015
Aug 12, 2014
Mar 15, 2017
Mar 15, 2017
Oct 17, 2016
Apr 24, 2016
May 14, 2016
May 14, 2016
Nov 23, 2015
Sep 11, 2015
Sep 21, 2015
Mar 15, 2017
Sep 8, 2015
Sep 8, 2015
May 14, 2016
Sep 11, 2015
Mar 9, 2017
Nov 23, 2015
May 14, 2016
Sep 16, 2015
Oct 30, 2015
May 14, 2016
Mar 15, 2017
Nov 23, 2015
May 14, 2016
Sep 16, 2015
May 9, 2019
May 22, 2015
Sep 13, 2015
Sep 12, 2015
Mar 15, 2017
Sep 12, 2015
Jun 2, 2017
May 14, 2016
Sep 21, 2015
Mar 15, 2017
May 6, 2014
May 13, 2014
May 13, 2014
Jun 2, 2017
Sep 16, 2015
Mar 15, 2017
Sep 16, 2015
Mar 15, 2017
Sep 11, 2015
May 6, 2014
May 14, 2016
May 14, 2016
Sep 11, 2015
Sep 11, 2015
May 14, 2016
May 31, 2016
Sep 18, 2015
Oct 17, 2015
Sep 14, 2015
Sep 20, 2015
Jun 2, 2017
Mar 15, 2017
Sep 21, 2015
May 6, 2014
Sep 8, 2015
Sep 8, 2015
May 9, 2015
May 9, 2015
May 6, 2014
May 24, 2016
May 24, 2016
Oct 18, 2015
May 14, 2016
May 14, 2016
May 14, 2016
May 14, 2016
Mar 15, 2017
Mar 15, 2017
Aug 12, 2014
Sep 18, 2015
Aug 28, 2015
May 1, 2015
May 1, 2015
Oct 18, 2015
Feb 16, 2016
Sep 12, 2015
Dec 22, 2014
Aug 12, 2014
Aug 12, 2014
Aug 12, 2014
Aug 12, 2014
Sep 3, 2015
Sep 3, 2015
May 14, 2016
Sep 8, 2015
Sep 8, 2015
Oct 17, 2016
Oct 17, 2016
Sep 8, 2015
Nov 23, 2015
May 22, 2015
May 14, 2016
Sep 7, 2015
Aug 28, 2015
Aug 28, 2015

Repository files navigation

fb-adb is a tool for interacting with Android systems. It does much of what adb does, but with better remote shell support and, hopefully, fewer bugs. Differences between adb and fb-adb are that fb-adb:

  • is binary clean (no LF -> CRLF mangling)
  • transmits and updates window size
  • distinguishes standard output and standard error
  • properly muxes streams with independent flow control
  • allows for ssh-like pty allocation control
  • propagates program exit status instead of always exiting with status 0
  • properly escapes program arguments
  • kills remote program
  • provides a generic facility to elevate to root without re-escaping

DOWNLOADS

You can use Homebrew to install fb-adb binaries:

brew install fb-adb

BUILDING

An out-of-tree build is required. You'll need a copy of the Android NDK: tell configure about it by setting the ANDROID_NDK environment variable to your NDK path or by using the --with-android-ndk argument to the configure script.

For example:

./autogen.sh
export ANDROID_NDK=/path/to/android-ndk
mkdir build
cd build
../configure
make

If building on Mac, you need gmake to build. You can use Homebrew to get it:

brew install homebrew/core/make

on earlier systems this was:

brew tap homebrew/dupes
brew install homebrew/dupes/make

and then use gmake instead of make.

RUNNING

The fb-adb executable itself has no dependencies other than the adb executable, which must be on PATH. Generally, you can use fb-adb just like adb; fb-adb forwards unknown commands to adb. fb-adb supports the same device-selection options that adb does.

fb-adb shell is the fancy shell command that supports the features described above. Run fb-adb shell -h for additional options.

EXAMPLES

  • Capture a screenshot from device and write it locally to a timestamped file:

    fb-adb rcmd screencap -p > screenshot-$(timestamp).png

  • Dump database.db of the com.bar.foo app:

    fb-adb rcmd -u com.bar.foo sqlite3 /data/data/com.bar.foo/databases/database.db .d

  • Open remote shell as the user com.bar.foo:

    fb-adb shell -u com.bar.foo