tree: e08dd0eaf5c07338b02b6208c2186810277b0162 [path history] [tgz]
  1. adb/
  2. adb-file-sync/
  3. adb-reboot/
  4. adb-shell/
  5. BUILD.gn
  6. README.md
src/developer/adb/bin/README.md

adb daemon (adbd) on Fuchsia

This directory contains code for Fuchsia device side adb daemon support - adb protocol server and adb services.

NOTE: The purpose of this tool is mainly to support hardware testing workflows. Please consult the OWNERS before using adbd on Fuchsia for additional use cases.

Below is the list of adb commands supported currently.

Note that these commands provide functionality similar to that of adb on Android but do not try to match the behavior. These commands are backed by Fuchsia concepts like components, packages, capabilities etc. and are closer to ffx counterparts in terms of the behavior.

How to include adbd in a Fuchsia image

To include the Fuchsia adb daemon, add these labels to fx set

--with-base '//src/developer/adb:adb'\
--args='core_realm_shards+=["//src/developer/adb:core_shards"]'

Usage

The general usage of the adb command line tool is described in the Android docs. Specific differences in Fuchsia are described in this section.

To get started with adb on Fuchsia -

  • Make sure that the Fuchsia device is running an image that is built with adb support as mentioned in the previous section.

  • Connect the device to the development host using a USB cable. Optionally, you can ensure that adb interface is enabled by using tools like lsusb (on Linux hosts) or equivalent tools on other platforms. Example output of lsusb -

    $ lsusb
    Bus 001 Device 073: ID 18d1:a025 Google Inc. ADB
    
    or
    
    Bus 001 Device 073: ID 18d1:a026 Google Inc. CDC Ethernet & ADB
    
  • Download the stock adb client from Android SDK onto the development host or use prebuilt adb client from Fuchsia tree //prebuilt/starnix/internal/android-image-amd64/adb.

Using adb shell

adb shell is built to share the same backend as ffx component explore. By default, it is configured to use /bootstrap/console-launcher moniker, meaning the adb shell will have same capabilities as serial console. You can update the structured configuration in //src/developer/adb/bin/adb-shell/BUILD.gn to change the moniker at build time. All of the Fuchsia CLI tools that can run on the serial console should work in the same fashion on adb shell.

Using adb file transfer

adb file transfer would allow you to push/pull files from a Fuchsia device. This shares the same backend API as ffx component storage. Similar to ffx component storage, you need to be aware of the moniker of the component you wish to push/pull a file. Alternatively, you can set the default moniker in the component args in //src/developer/adb/bin/adb-file-sync/meta/adb-file-sync.cml. Example commands -

adb push ~/tmp.txt /core/exceptions::/tmp
adb pull /core/exceptions::/tmp/tmp.txt ~/foo.txt