Last active
November 30, 2022 01:40
-
-
Save Iljo/b957d077681eb73571c4a1b27787b1ba to your computer and use it in GitHub Desktop.
Mount Android folder locally
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env bash | |
# Local directory to which remote directory should be mounted | |
LOCAL_DIR=~/mnt | |
# Remote/Androids directory we want to mount localy, i.e. one of it's | |
# subdirectories should contain our database file | |
ANDROID_DIR=/storage/emulated/0/Android/data | |
# Local port that we want to forward to remotes ssh port | |
LOCAL_PORT=2222 | |
# Remote port on which ssh server is running | |
REMOTE_PORT=22 | |
# Actual work | |
fusermount -u $LOCAL_DIR | |
adb forward tcp:$LOCAL_PORT tcp:$REMOTE_PORT && | |
sshfs localhost:$ANDROID_DIR $LOCAL_DIR -C -p $LOCAL_PORT \ | |
-osshfs_sync,no_readahead,sync_readdir,direct_io,sync_read,cache=no |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment