zach-klippenstein / adbfs Goto Github PK
View Code? Open in Web Editor NEWA FUSE filesystem that uses goadb to expose Android devices' filesystems.
License: Apache License 2.0
A FUSE filesystem that uses goadb to expose Android devices' filesystems.
License: Apache License 2.0
Need to actually start /debug/trace server on --debug
flag.
I'd like to assist in updating adbfs, but found that the Error
type and functions such as WrapErrf
are now internal to goadb. There also seems to be some duplication:
How can I help with this?
Hi Zach,
I had a look at your code and I really liked the structure of it 👍 So now I am trying to get adbfs working on my Mac, but I'm getting the error above. I take it it's coming from go-fuse (MountRoot function). I wonder if it's an incompatiblity between the old go-fuse version and the up-to-date OSXFUSE. Any ideas?
Installing on OSX, I received this output when running the go get
command:
# github.com/hanwen/go-fuse/fuse/nodefs golang/src/github.com/hanwen/go-fuse/fuse/nodefs/files_darwin.go:5: imported and not used: "time" golang/src/github.com/hanwen/go-fuse/fuse/nodefs/syscall.go:11: undefined: syscall.SYS_UTIMENSAT
Then when running ./install.sh I received:
+ go install -ldflags '-X github.com/zach-klippenstein/adbfs/internal/cli.buildSHA=23ff9c5' -v ./cmd/... internal/cli/adbfs_config.go:3:8: cannot find package "gopkg.in/alecthomas/kingpin.v2" in any of: /usr/local/Cellar/go/1.5.2/libexec/src/gopkg.in/alecthomas/kingpin.v2 (from $GOROOT) /Users/jules/Downloads/golang/src/gopkg.in/alecthomas/kingpin.v2 (from $GOPATH)
Failing:
cd `go list -f '{{.Dir}}' github.com/zach-klippenstein/adbfs`
go get: github.com/Sirupsen/[email protected]: parsing go.mod:
module declares its path as: github.com/sirupsen/logrus
but was required as: github.com/Sirupsen/logrus
Which is pretty clearly from sirupsen/logrus#1041 and seems like a pretty simple fix.
When I run ./install.sh
, build fails with
pattern ./cmd/...: directory prefix cmd does not contain main module or its selected dependencies
I think your source is not compatible with up to date go versions and needs update.
go version
: go version go1.21.6 linux/amd64
Regards!
Hi, I'm trying adbfs, but launching it fails with the following error (same for the adbfs binary):
% ./go.sh run cmd/adbfs/main.go ~/user/mnt + go run -ldflags '-X github.com/zach-klippenstein/adbfs/internal/cli.buildSHA=23ff9c5' cmd/adbfs/main.go /home/voidzero/user/mnt panic: build SHA not set goroutine 1 [running]: github.com/zach-klippenstein/adbfs/internal/cli.BuildSHA(0x0, 0x0) /home/voidzero/user/go/src/github.com/zach-klippenstein/adbfs/internal/cli/cli.go:33 +0x83 github.com/zach-klippenstein/adbfs/internal/cli.versionString(0x93e480, 0x5, 0x0, 0x0) /home/voidzero/user/go/src/github.com/zach-klippenstein/adbfs/internal/cli/cli.go:50 +0x31 github.com/zach-klippenstein/adbfs/internal/cli.Initialize(0x93e480, 0x5, 0xbe32a0) /home/voidzero/user/go/src/github.com/zach-klippenstein/adbfs/internal/cli/cli.go:25 +0x84 main.main() /home/voidzero/user/go/src/github.com/zach-klippenstein/adbfs/cmd/adbfs/main.go:48 +0x4b goroutine 9 [runnable]: text/template/parse.lexText(0xc20807d180, 0xa3b040) /usr/lib/go/src/text/template/parse/lex.go:228 +0x37b text/template/parse.(*lexer).run(0xc20807d180) /usr/lib/go/src/text/template/parse/lex.go:198 +0x5d created by text/template/parse.lex /usr/lib/go/src/text/template/parse/lex.go:191 +0x1ac goroutine 8 [syscall]: os/signal.loop() /usr/lib/go/src/os/signal/signal_unix.go:21 +0x1f created by os/signal.init·1 /usr/lib/go/src/os/signal/signal_unix.go:27 +0x35 goroutine 17 [syscall, locked to thread]: runtime.goexit() /usr/lib/go/src/runtime/asm_amd64.s:2232 +0x1 exit status 2
What i am doing:
adbfs
and it completed without errors.$ adbfs --device MTKWWMRMR7S9PNRMNSG --mountpoint ~/mnt/adbfs/
INFO[2017-08-22T16:35:46.405460768+03:00] adbfs v1.0.0
INFO[2017-08-22T16:35:46.405557307+03:00] stat cache ttl: 300ms
INFO[2017-08-22T16:35:46.405752685+03:00] connection pool size: 2
INFO[2017-08-22T16:35:46.405767761+03:00] device root: /sdcard
INFO[2017-08-22T16:35:46.486758309+03:00] server ready.
INFO[2017-08-22T16:35:46.486829354+03:00] mounted MTKWWMRMR7S9PNRMNSG on /home/wwarlock/mnt/adbfs
$ ls -la ~/mnt/adbfs/
total 8
d--------- 0 wwarlock vglusers 0 янв 1 2010 .
d--------- 0 wwarlock vglusers 0 янв 1 2010 .
drwxr-xr-x 6 wwarlock vglusers 4096 авг 22 16:30 ..
drwxr-xr-x 6 wwarlock vglusers 4096 авг 22 16:30 ..
The command adb shell
works normally.
I see all files inside (except mounted SDCARD maybe, but I'm not sure am I must see it or not).
Also I can get all files by adb pull
.
So, I think there is some error in adbfs
.
Please write if I can provide some additional logs.
P.S. Ah, yeah, I almost forgot.
The adbfs-automount
utility shows me the strange error. It cannot get device info.
$ adbfs-automount --root ~/mnt/adbfs
INFO[2017-08-22T16:33:20.119775226+03:00] adbfs-automount v1.0.0
INFO[2017-08-22T16:33:20.129427638+03:00] using mount root /home/wwarlock/mnt/adbfs
INFO[2017-08-22T16:33:20.129456387+03:00] mounting as read-only filesystem
INFO[2017-08-22T16:33:20.129572653+03:00] automounter ready.
ERRO[2017-08-22T16:33:20.130549445+03:00] error getting device info for MTKWWMRMR7S9PNRMNSG: ParseError: error performing GetDeviceInfo(ListDevices) on *adb.DeviceClient (DeviceSerial[MTKWWMRMR7S9PNRMNSG])
^CINFO[2017-08-22T16:33:21.927559858+03:00] exiting.
INFO[2017-08-22T16:33:21.927625987+03:00] shutting down all mount processes…
INFO[2017-08-22T16:33:21.927656984+03:00] all processes shutdown.
P.P.S.
My OS is Ubuntu 17.04
Hi, and thanks for this awesome piece of software! (especially with failures of libmtp)
However, the mounter only mounts the /sdcard on the device. I need to access both internal & external sd cards of my phone. (residing in /storage)
I didn't see any options for specifying that.
Is it supported by any tricks?! (other than rooting the device, of course)
Repro steps:
/sdcard
is a symlink to a mountpoint that only gets mounted later in the boot process).Observed behavior: adbfs crashes because it can't find the target.
Error looks like:
error getting device info for 00b8dbcb7c4f360c: ParseError: error performing GetDeviceInfo(ListDevices) on *goadb.DeviceClient (DeviceSerial[00b8dbcb7c4f360c])
Setup needs to include:
go get gopkg.in/alecthomas/kingpin.v2
Otherwise you get this error:
$ ./install.sh
+ go install -ldflags '-X github.com/zach-klippenstein/adbfs/internal/cli.buildSHA=23ff9c5' -v ./cmd/...
internal/cli/adbfs_config.go:3:8: cannot find package "gopkg.in/alecthomas/kingpin.v2" in any of:
/usr/local/opt/go/libexec/src/gopkg.in/alecthomas/kingpin.v2 (from $GOROOT)
/Users/jalmeida/golang/src/gopkg.in/alecthomas/kingpin.v2 (from $GOPATH)
Yea, Finder doesn't seem to think it can write, and some other apps (namely Preview). I've had better luck with things that don't try to do a bunch of fancy metadata/versioning stuff (command line, Sublime Text). I think the Finder problem might have to do with resource forks, but adbfs isn't showing any errors, just that Finder opens and closes the ._* files a bunch and occasionally writes to them.
I'm not a Go user so I don't know exactly what this error means:
$ go get github.com/zach-klippenstein/adbfs
package github.com/zach-klippenstein/goadb/util: cannot find package "github.com/zach-klippenstein/goadb/util" in any of:
/usr/local/Cellar/go/1.14.4/libexec/src/github.com/zach-klippenstein/goadb/util (from $GOROOT)
/Users/agross/go/src/github.com/zach-klippenstein/goadb/util (from $GOPATH)
/Users/agross/go/src/github.com/zach-klippenstein/goadb/util.go
exists, but it seems that it is not considered.
$ go version
go version go1.14.4 darwin/amd64
When using adbfs on Linux, I get strange symbolic linking behaviour:
$ ls -al /sdcard
/sdcard -> '/home/gqueiroz/mnt/SM_G950F-ce0217129a24c61205/storage/self/primary'$'\n'
$ ls -al /storage/self/primary
/storage/self/primary -> '/mnt/user/0/primary'$'\n'
$ ls -al /mnt/user/0/primary
/mnt/user/0/primary -> '/storage/emulated/0'$'\n'
$ ls -al /storage/emulated/0
[all my files]
The README.md
states in one place
`adbfs --device 02b5c5a809117c73 --mountpoint /mnt`
and shortly after
``` [...] adbfs -device 02b5c5a809117c73 -mountpoint ~/mnt [...] ```
So, in one case the options are described to start with --
, in the other case with -
.
I propose to unify to the correct case.
Regards!
It looks like the runCommand escaping is quite naive, and will pass along special characters without escaping.
As an example:
cd mount-point
echo Hello > '$(touch /data/local/tmp/hello)'
rm '$(touch /data/local/tmp/hello)'
Should propagate to the ADB protocol command:
shell:"$(touch /data/local/tmp/hello)"
Which allows arbitrary command execution.
I'm successfully mounting emulators on mac, but I can't seem to write to them. I'm attempting to write to the /sdcard dir, and receiving:
jules@Juless-MacBook-Pro ~/mnt/Google_Nexus_5_5_1_0_API_22_1080x1920_updated-192_168_57_101_5555/sdcard $ touch foo.text touch: foo.text: Function not implemented
Is writing unimplemented yet?
$ ./install.sh
+ go install -ldflags '-X github.com/zach-klippenstein/adbfs/internal/cli.buildSHA=23ff9c5' -v ./cmd/...
github.com/hanwen/go-fuse/fuse/nodefs
# github.com/hanwen/go-fuse/fuse/nodefs
../../hanwen/go-fuse/fuse/nodefs/files_darwin.go:5: imported and not used: "time"
../../hanwen/go-fuse/fuse/nodefs/syscall.go:11: undefined: syscall.SYS_UTIMENSAT
The unused 'time' import only looks like a warning, but the other seems like an error.
Using BASH rmdir deletes non-empty directories. This is an unexpected behavior, leading to potential data loss.
While following the instruction, I get this.
(base) ~/Desktop/ go get github.com/zach-klippenstein/adbfs
go: go.mod file not found in current directory or any parent directory.
'go get' is no longer supported outside a module.
To build and install a command, use 'go install' with a version,
like 'go install example.com/cmd@latest'
For more information, see https://golang.org/doc/go-get-install-deprecation
or run 'go help get' or 'go help install'.
Instruction should be fixed. Thanks.
Needed if adb is not in PATH
, especially when running as a LaunchAgent.
Error message in log is:
exec: \"adb\": executable file not found in $PATH"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.