anbox / anbox

Anbox is a container-based approach to boot a full Android system on a regular GNU/Linux system
https://anbox.io
GNU General Public License v3.0
8.89k stars 1.16k forks source link

transfer files from linux to anbox #1010

Closed bouhmidi closed 5 years ago

bouhmidi commented 5 years ago
  1. Please check that no similar bug is already reported. Have a look on the list of open bugs at https://github.com/anbox/anbox/issues

  2. Make sure you are running the latest version of Anbox before reporting an issue. Update snap to latest: snap refresh --devmode --edge anbox

  3. Make sure you have debug logs enabled: sudo snap set anbox debug.enable=true

  4. Reproduce the error while debug logs enabled.

  5. Run the anbox logs collection utility and attach the tar file. sudo /snap/bin/anbox.collect-bug-info

  6. Please paste the result of anbox system-info below:

    [please paste printout of `anbox system-info` here]

Please describe your problem:

What were you expecting?:

Additional info:

morphis commented 5 years ago

Please describe more in detail what you want to have as feature. Just a title isn't really enough.

bouhmidi commented 5 years ago

whenever i try to copy paste linux files into anbox directories it refuses to complete it . i know its not a good idea but i really want to send some files to anbox's emulated storage if you know how to do it i would be grateful

Arucard1983 commented 5 years ago

From my experience, use the adb tool to upload or download files.

To upload files, use: adb push <files> '/sdcard/Download' Examples: adb push *.mp4 '/sdcard/Movies' adb push * sdcard/Download'

To download files, use adb pull '/sdcard/Download/ . Examples: adb pull '/sdcard/Movies' .

And so on, as long you start Anbox first of all, or the adb bridge tools will fail to connect the virtual storage.

ajvsol commented 5 years ago

It would be great to have it at the point where there's drag-and-drop functionality.

parithy commented 5 years ago

@morphis Should this still have "needs info" tag instead of "enhancement"

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

shemgp commented 4 years ago

You may use adbfs to mount the anbox filesystem in linux so that you may drag and drop files using nautilus: https://github.com/spion/adbfs-rootless

kqvanity commented 4 years ago

Install "X-plore file manager" on anbox , after opening it ,click on "Wifi file sharing" and then activate wifi server .. open the ip address:port on your linux machine's browser ...and start drag and drop files

vigneshsnaik commented 3 years ago

I know that i am too late but better late than never the easiest way is using kde connect it will give u the folder in the dolphin file manager itself(dont know about others pls try it)

Thank you

5p4r70n commented 3 years ago

sudo setfacl -m 'u:username:rwx' /var/snap/anbox/common/data/media

with this command i can able to access the anbox filesystem in linux.. then create a link or shortcut of the folder then we can drag and drop files.. :)

sarah-noor-12232 commented 3 years ago

`--to get access to anbox directory 1- you need to take ownership of media folder so that it can be read, otherwise all files inside it "don't exist" sudo chown -R username /var/snap/anbox/common/data/media`

2- create a symlink in your home directory sudo ln -s /var/snap/anbox/common/data/media/0 /home/_username_

although this is a bit of a brute force considering you are taking ownership of media folder, it works Also a clarification: replace the username in italics with your username

Edit: Turns out upon reboot and restarting anbox session, it might retake control of your directory. So I just made a desktop entry (using menulibre) and added the commands into it using pkexec instead of sudo Now I just have to click it and enter my password whenever I want access to anbox directory:

Using pkexec provides you the graphic interface to enter password so that you don't have to enable running command in terminal

The command: pkexec sh -c 'rm /home/sarah/Anbox/0 && chown -R sarah /var/snap/anbox/common/data/media && ln -s /var/snap/anbox/common/data/media/0 /home/sarah/Anbox'

(Please note that here my username is sarah and I'm making the symlink in a folder named Anbox in my home directory)

The desktop file (for those who don't use menulibre or alacarte)

[Desktop Entry] Version=1.1 Type=Application Name=Anbox Directory Control Comment=App to take control of the anbox directory Icon=/home/sarah/Downloads/anbox-icon.png Exec=pkexec sh -c 'rm /home/sarah/Anbox/0 && chown -R sarah /var/snap/anbox/common/data/media && ln -s /var/snap/anbox/common/data/media/0 /home/sarah/Anbox' Actions=

You will also need to add your own location for the icon

ProgrammingLife commented 2 years ago

Tried all those things but my Downloads folder is still empty. Anbox installed with snap.

$ adb push 1.apk '/sdcard/Download'
...copying ...

$ adb devices
List of devices attached
emulator-5558   device

$ sudo chown -R _username_ /var/snap/anbox/common/data/media
$ sudo cp 1.apk /var/snap/anbox/common/data/media
$ sudo cp 1.apk /var/snap/anbox/common/data/media/0/Download/
sarah-noor-12232 commented 2 years ago

Tried all those things but my Downloads folder is still empty. Anbox installed with snap.

$ adb push 1.apk '/sdcard/Download'
...copying ...

$ adb devices
List of devices attached
emulator-5558 device

$ sudo chown -R _username_ /var/snap/anbox/common/data/media
$ sudo cp 1.apk /var/snap/anbox/common/data/media
$ sudo cp 1.apk /var/snap/anbox/common/data/media/0/Download/

Hmm, I'm not on Linux anymore so I cannot test it, but did you replace username with your username in chown command? Also try restarting anbox after moving files.

LauDoev commented 2 years ago

I have the same issue, but by coincidence I found a workaround. When I adb push a file to /sdcard/Download, the file doesn't appear in the default file manager's Download folder, but when I go to Settings>Storage>Explore, I can see a number of folders, also one called 'Download', and this one does contain the pushed file.

Shanmukhsvstp commented 1 year ago

This Workef For Me:

  1. Goto Filesystem --> var --> snap --> anbox --> common --> data --> media (You may need to enter your password authentication here) --> 0 --> Download
  2. You can drag and drop here. I dont think paste option works here.
  3. Optional Below:
  4. I also found new easiest way to deploy nextjs app on firebase hosting. Check my channel here: https://www.youtube.com/@Apps_By_PSS