docker-android icon indicating copy to clipboard operation
docker-android copied to clipboard

how mount sdcard

Open mehrdad-abdoli opened this issue 7 years ago • 2 comments

I need to mount sdcard and send some images for app and site tests. How can it be done? I shared volume to docker but can not use adb push as it return: adb: error: failed to copy '/media/qa105.jpg' to '/storage/sdcard/qa105.jpg': remote Read-only file system

mehrdad-abdoli avatar Jan 09 '18 13:01 mehrdad-abdoli

@mehrdad-abdoli You may try to mount sdcard (*.img) in the host running docker and to copy files to there. If you don't have additional sdcard image, try userdata-qemu.img or userdata.img in /root/android_emulator in docker-android containers.

$ mkdir ./sdcard
$ mount <sdcard_img> ./sdcard
$ copy <image_files> ./sdcard/image_path

greenerchen avatar Mar 08 '18 16:03 greenerchen

@mehrdad-abdoli I think you adressed the wrong path. For me it works perfectly if I push the files to /sdcard/picture.jpg which will the look something like that:

  • connect to device: adb connect <docker-ip>:5555

  • become root (not needed): adb root

  • push data: adb push /picture.jpg /sdcard/picutre.jpg if you have more than one device connected: adb -s <docker-ip>:5555 push /picture.jpg /sdcard/picutre.jpg if you only choose the /sdcard path, then you need to display internal storage stackoverflow

  • You can also push it to the Download folder: /sdcard/Download/picture.jpg

HasBert avatar Mar 09 '19 17:03 HasBert