• Stars
    star
    150
  • Rank 247,323 (Top 5 %)
  • Language
    Go
  • License
    Apache License 2.0
  • Created over 9 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A FUSE filesystem that uses goadb to expose Android devices' filesystems.

adbfs Build Status GoDoc

A FUSE filesystem that uses goadb to expose Android devices' filesystems.

Features

  • Read access to Android device filesystems through adb, without root. Of course, this is limited to files that are accessible to whatever user adb shell runs the shell as on the device.
  • Experimental write support (run with --no-readonly). Notably, on OSX, Finder can't copy files into mounted directories (issue #34).
  • Automounter daemon that detects when devices are connected and mounts them under a configurable directory.
  • Communicates directly with adb server using goadb instead of delegating to the adb client command like most adb-based filesystems.

Quick Start

Installation

adbfs depends on fuse. For OS X, install osxfuse. Then run:

$ export GO15VENDOREXPERIMENT=1
$ go get github.com/zach-klippenstein/adbfs
$ cd `go list -f '{{.Dir}}' github.com/zach-klippenstein/adbfs`
$ ./install.sh

Let's mount some devices!

The easiest way to start mounting devices is to use adbfs-automount to watch for newly-connected devices and automatically mount them.

$ mkdir ~/mnt
$ adbfs-automount

You probably want to run this as a service when you login (e.g. create a LaunchAgent on OSX). For example, on OSX, paste this into ~/Library/LaunchAgents/com.adbfs-automount.plist (substituting "zach" for your own username, of course):

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>Label</key>
  <string>com.adbfs-automount</string>
  <key>ProgramArguments</key>
  <array>
    <string>/Users/zach/go/bin/adbfs-automount</string>
    <string>--adb=/Users/zach/android-sdk/platform-tools/adb</string>
    <string>--adbfs=/Users/zach/go/bin/adbfs</string>
  </array>
  <key>RunAtLoad</key>
  <true/>
  <key>KeepAlive</key>
  <true/>
  <key>StandardOutPath</key>
  <string>/Users/zach/adbfs.log</string>
  <key>StandardErrorPath</key>
  <string>/Users/zach/adbfs.log</string>
</dict>
</plist>

then run

$ launchctl load ~/Library/LaunchAgents/com.adbfs-automount.plist
$ launchctl start com.adbfs-automounter

adfs

Usage

Devices are specified by serial number. To list the serial numbers of all connected devices, run:

adb devices -l

The serial number is the left-most column. To mount a device with serial number 02b5c5a809117c73 on /mnt, run:

adbfs --device 02b5c5a809117c73 --mountpoint /mnt

Example:

$ adb devices -l
List of devices attached 
02b5c5a809117c73       device usb:14100000 product:hammerhead model:Nexus_5 device:hammerhead
$ mkdir ~/mnt
$ adbfs -device 02b5c5a809117c73 -mountpoint ~/mnt
INFO[2015-09-07T16:13:03.386813059-07:00] stat cache ttl: 300ms
INFO[2015-09-07T16:13:03.387113547-07:00] connection pool size: 2
INFO[2015-09-07T16:13:03.400838775-07:00] server ready.
INFO[2015-09-07T16:13:03.400884026-07:00] mounted 02b5c5a809117c73 on /Users/zach/mnt
โ‹ฎ

adbfs-automount

adbfs-automount listens for new device connections to adb and runs an instance of adbfs for each device to mount it. Most arguments are passed through to adbfs, but there are a few arguments specific to the automounter:

--root: the directory under which to mount devices. If this is not specified, it will try to figure out a good path. On OSX, ~/mnt is used if it exists, else /Volumes. On Linux, it tries ~/mnt then /mnt.

--adbfs: path to the adbfs executable to run. If not specified, will search $PATH. The executable must be built from the same SHA as adbfs-automount, which will exit with an error if this is not the case.

--on-(un)mount: a command to run when a device is (un)mounted. Can be repeated to run multiple commands. E.g. --on-mount 'say $ADBFS_MODEL' --on-mount 'open $ADBFS_PATH' will speak the type of device and open it in Finder.

Running from Source

$ go run cmd/adbfs/main.go โ€ฆ

More Repositories

1

compose-fractal-nav

A proof-of-concept of a fractal/recursive navigation system.
Kotlin
335
star
2

goadb

A Golang library for interacting with adb.
Go
229
star
3

compose-undo

Undo snapshot state changes in Compose.
Kotlin
142
star
4

goregen

randexp for Go.
Go
90
star
5

compose-autotransition

A simple library for automatically animating between Compose states.
Kotlin
77
star
6

compose-seqdiag

Sequence diagram renderer for Jetpack Compose.
Kotlin
60
star
7

compose-revealer

Kotlin
47
star
8

compose-model

Kotlin
36
star
9

compose-touchbar

Kotlin
16
star
10

go-typedregexp

typedregexp matches regular expressions into structs.
Go
15
star
11

statedatastore

A snapshot state wrapper for the Jetpack Datastore library.
Kotlin
13
star
12

compose-worksheet-blog

Code for a blog post about derivedStateOf.
Kotlin
12
star
13

captivate

A simple service for detecting wifi hotspots that ask for information (captive portals), and automatically showing the login page.
Java
9
star
14

flow-operators

Some additional operators for Kotlin's cold stream library Flow
Kotlin
8
star
15

snapshot-state-swiftui-bridge

An experiment to consume Jetpack Compose's snapshot state change tracking from SwiftUI
Kotlin
7
star
16

web-adb

A Chrome extension and accompanying native adb proxy for working with Android devices over the Android Debug Bridge.
Go
7
star
17

regen

Simple command-line utility for generating strings from regular expression patterns.
Go
6
star
18

coroutine-workflows-poc

This is a proof-of-concept for entirely coroutine-based reactor + workflows.
Kotlin
6
star
19

rxkotlin

Pretending to write a cold streams library for Kotlin using coroutines.
Kotlin
5
star
20

textbuffer-sandbox

A repo for benchmarking different text buffer implementations.
Kotlin
5
star
21

go-pcomb

Parser Combinators for Golang
Go
4
star
22

gofontviewer

Render TTF fonts to an HTML5 Canvas in Go.
Go
3
star
23

zach-klippenstein.github.com

My personal website.
HTML
2
star
24

fraknums

Kotlin port of https://github.com/pyricau/fragnums
Kotlin
2
star
25

afpfs-ng

afpfs-ng is an Apple Filing Protocol client that will allow BSD, Linux and Mac OS X systems to access files exported from a Mac OS system with AFP over TCP.
Shell
2
star
26

with-intent

With Intent is a utility app for developers that lets you build and send intents without writing up a script or a test app.
Kotlin
2
star
27

ReproComposeAndroidViewTreeOwnersBugs

Kotlin
1
star
28

workflow-react-native-experiment

Experimenting with wiring up React Native to Workflow
Kotlin
1
star
29

snapshot-linked-list-blog

Kotlin
1
star
30

phrase-styling-example

Demonstrates a couple of different ways to style text with Phrase
Java
1
star