I use T2Q210 versions and android 4 systems.
I try to copy executable file lcd into sd card, then copy in /data. But there is not copy command in android. I try mv. But it hints device link error.
I try cat lcd > /data/. There is lcd in data, but file lcd Execute failure.
My problem is:
How to copy file in /data?
Is my lcd file des break down when cat?
Is android could execute the linux executable file which I cross compile?
You don't have write access of /data folder unless your device is rooted.
However I found I have write access of /data/local/tmp on my Samsung S4 running android 4.3.
So please try :
adb -d push your_exe /data/local/tmp
adb -d shell
/data/local/tmp/your_exe
Related
I want to change the kernel and ramdisk.img file to install magisk, however, the folder is "read-only"
My setup:
Android-x86_9.0-r2_(x8) running on Proxmox (using QEMU and qcow2
formatted image)
GRUB, GBT installed, and I selected install with
write permissions at the android installation
I tried to install magisk using the following guide: https://forum.xda-developers.com/android/general/guide-android-x86-rooted-magisk-t4077477
I successfully patched the boot.img and got the new kernel and ramdisk.img file. However, I wanted to replace them now, but I get the following error when I want to modify something in the folder where the old kernel and ramdisk.img is located:
Read-only file system
I connected to android using ADB (but also tried the terminal emulator on android itself). I already tried adb remount and other mounting options, but nothing works. Android runs as root.
The folder where the ramdisk.img and boot is located: /mnt/media_rw/Android-x86_9.0-r2_(x86)/
When running
mount | grep mnt
I receive the following (which means the folder Android-x86_9.0-r2_(x86) where the ramdisk.img etc. is stored is read-only:
/dev/block/vold/public:11,0 on /mnt/media_rw/Android-x86_9.0-r2_(x86) type iso9660 (ro,dirsync,nosuid,nodev,noexec,relatime,nojoliet,utf8,check=s,map=n,blocksize=2048,uid=1023,gid=1023)
When I try to mount it to rw using:
mount -o remount,rw /dev/block/vold/public:11,0 /mnt/media_rw/Andro*
I get:
'/dev/block/vold/public:11,0' is read-only
What can I do to change the ramdisk.img and kernel so I can install magisk?
Thank you very much!
I was having the same issue. All you can do install gearlock and find the img somewhere in gearlock/gearrot folder. You can modify that files as you want.
More info:
https://github.com/axonasif/gearlock
If you attach android device to PC you can browse files and dirs. It is possible to get this directory using Environment.getExternalStorage(). You can use it from your application and create accessible files and dirs. It works fine.
On my devices this path looks like /storage/emulated/0 and if i try adb push to this directory i will get access denied error. Is it possible to copy files using adb to the same folder as Windows Explorer does?
D:\...\tools>adb push ACCOUNTS.DB /storage/emulated/0
failed to copy 'ACCOUNTS.DB' to '/storage/emulated/0': Permission denied
58969 KB/s (606505 bytes in 0.010s)
I'm implementing automated import/export and i want files to be accessible without adb shell in case anything will go wrong.
Currently using variable$EXTERNAL_STORAGE as workaround, it works for both adb and application.
Device: Asus Fonepad 7, Android 5.0, tried Genymotion Custom Tablet 6.0 - works.
Try to use /sdcard/. Although it is strongly discouraged to do this in code. It seems to be the only way with adb :
$ adb push somefile /storage/emulated/0/somefile
[100%] /storage/emulated/0/somefile
adb: error: failed to copy 'somefile' to '/storage/emulated/0/somefile': Read-only file system
$ adb push somefile /sdcard/somefile
[100%] /sdcard/somefile
By the way, on my device they don't have the same value : Environment.getExternalStorage() points to /storage/emulated/0/ while /sdcard points to /storage/emulated/legacy.
It's pretty easy, internal storage is unavailable on non-rooted devices. So as was mentioned in bwt answer you just need to push your data to sdcard :
adb push somefile /sdcard/somefile
With retrieving files from your filesystem you'll also have few problems. But with the case of pulling a database from a debug application - you'll just need to change file permission via chmod.
Here you have a useful link - XDA guys about adb
I am trying to develop a simple pygame with Ubuntu Linux 11.10 for my Motorola android phone. I am having trouble getting the "adb push" command to work. I get an failed to copy 'foo.txt' to '/media/MOT': No such file or directory error message. What am I doing wrong?
Here is what I tried so far:
The phone's SD card is mounted at /media/MOT/ and I am able to ls, create a folder and delete a folder in it.
user#linuxlappy:~$
user#linuxlappy:~$ cd /media/MOT/
user#linuxlappy:/media/MOT$ ls
Android burstlyImageCache burstlyVideoCache data DCIM download gstomperdemo LOST.DIR slacker temp.apk
user#linuxlappy:/media/MOT$ mkdir writetest
user#linuxlappy:/media/MOT$ rmdir writetest/
The file that I am trying to copy is foo.txt in my /home/user/ directory
user#linuxlappy:/media/MOT$ cd /home/user/
user#linuxlappy:~$ ls foo.*
foo.txt foo.txt~
I enabled USB debugging on the phone with:
Settings > Applications > Development > USB debugging.
I believe I have adb installed correctly, I am able to list the phone with adb devices.
user#linuxlappy:~$ adb devices
List of devices attached
0910E8201700B017 device
When I try to push a simple text file to the SD card I get this error message.
user#linuxlappy:~$ adb push foo.txt /media/MOT
failed to copy 'foo.txt' to '/media/MOT': No such file or directory
user#linuxlappy:~$
The phone's SD card is mounted at /media/MOT/
Based on your terminal output, it is mounted on your desktop Linux environment as /media/MOT. In which case, to copy files to it, you use cp.
Using adb push, you need to use the path where the external storage resides on the phone. A common spot is /mnt/sdcard/, though it may vary. Also, bear in mind that, depending on your phone, external storage may not be available while you have it mounted as a volume on your desktop Linux environment.
I am trying to import a python library into SL4A. From my understanding, the easiest way to do this is to import the zipped files (egg files) of the python library into the SD Card and then import it into SL4A. Since I do not have an android device yet, I am working with the emulator. Whenever I try to push the zipped folder using the adb push command, it pops out an error saying the device is not connected. How do I push zipped files into the SD Card of an emulator and then access it via SL4A ? I want to use the commands in that library in the command line in SL4A.
Thanks !
You can create your own sdcard image, put files on it and after that mount in emulator.
To create image you can use mksdcard <size> <file>: mksdcard 1024M sdcard1.iso. After that you need to mount sdcard: mount -o loop sdcard1.iso /mnt/cdrom/. Next step: copy files, umount /mnt/cdrom/ and point to image in virtual machine properties.
Description
I'm trying to Push file (.so library) onto Android Device (Samsung NexusS) "system\lib" folder using Eclipse. But when I press "Push a file onto the device" an error appears:
[2011-06-24 15:41:21] Failed to push
selection: Read-only file system
Researches
To solve this problem I search through internet and find some articles and documentations, but nothing helps me, here are some articles and documentations which I have tried.
Read-Only File System" when trying to ADB Push an App
Here users suggest to write adb shell sysrw, but when I an permission denied error appeared:
sysrw: permission denied
Copying Files to or from an Emulator/Device Instance
Here on Android Developers Forum I found "You can use the adb commands pull and push to copy files to and from an emulator/device instance's data file. Unlike the install command, which only copies an .apk file to a specific location, the pull and push commands let you copy arbitrary directories and files to any location in an emulator/device instance."
I also try to run adb remount command, but same permission error appeared:
remount: permission denied
Question
How I can push file onto Android Device (NexusS) using eclipse or adb ?
Typically access to system folder requires root permission, so unless you have rooted your phone i.e. you have superuser permission its not possible to access system folder or change its permission.
Check this:
Rooting samsung Nexus S,
Okay I have done rooting of my device and push files into it.
To root your Android Nexus S device check How to get root and recovery for Nexus S on Windoes 7.
After do this:
$adb shell
#mount -o remount, rw -t yaffs2 /dev/block/mtdblock3 /system
#cat (file which you want) > (destination path)
Thats All !