Pushing file via ADB does not work

Hello @morphis

Can I upload a file to anbox emulator by using adb?
e.g.
adb push contacts.vcf /sdcard/

It shows me this error
adb: error: failed to copy ‘contacts.vcf’ to ‘/sdcard/contacts.vcf’: remote fchown failed: Operation not permitted
contacts.vcf: 0 files pushed. 0.2 MB/s (400 bytes in 0.002s)

I tried several ways but could not manage to pass.
If you have the solution, please help me out.

Best regards.

Alex.

Hey Alex
Could you share the file mode and ownership of the contacts.vcf file? and which Android version are you using? are you running the above command from the Anbox container?

BR
Gary

Hey @gary-wzl77 .

ls -l contacts.vcf
-rwxrwxrwx 1 ubuntu ubuntu 400 Apr 27 07:59 contacts.vcf

Anbox android version is 10.
Anbox container exposes adb service.

So, I am running this command from another machine where adb command is available.

Best regards.

Alex.

We confirmed that the issue could be reproduced with Android 10 image.

$ adb push test /sdcard/
test: 1 file pushed, 0 skipped. 0.1 MB/s (12 bytes in 0.000s)
adb: error: failed to copy 'test' to '/sdcard/test': remote fchown failed: Operation not permitted
$ adb push test /data/local/tmp
test: 1 file pushed, 0 skipped. 0.1 MB/s (12 bytes in 0.000s)

So instead of pushing the file to /sdcard/, doing that to /data/local/tmp worked for Android 10 image. It may have something to do with SDcardFS which was deprecated since Android 11.
Things worked fine with the Android 11/12/13 image. Could you give it a try with those images as an immediate step?
Thanks.

BR
Gary

Great, for Android 10, It worked when I pushed to /data/local/tmp
I will try with Android 11/12/13.

Thanks.

Best regards.

Alex.