Android:transfer error: Read-only file system - android

I want to push a *.mp3 file in to my emulator, but it gives me these 2 errors:
transfer error: Read-only file system
Failed to push selection: Read-only file system
To resolve the problem, i have done these works, but still not working:
1-Using CMD to do this: c:\android-sdk\platform-tools\>abd remount
2-Add these 2 lines to the AndroidManifest.xml
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
3-Set the SDcard in emulator configuration as 1024 Mb
The thing that makes me wonderful is that the sdcard folder in file explorer has all the necessary permissions

Here is a solution I found in other site, which is the only way that worked in my case:
In a terminal (I work on Mac OS X) I wnt to sdk/platform-tools directory (to get access to the adb shell) then I typed the following commands:
./adb shell
su
mount -o rw,remount rootfs /
chmod 777 /mnt/sdcard
and then typed exit to exit su, and exit again to exit the adb shell.

#atisman's answer got me working. There are two small bits to add to his response though:
First, picky as it seems, you might need an extra '-' in the unix command line, depending on your local OS. The only way it would work for me was:
mount -o -rw,remount rootfs /
The other item is to make sure you have actually defined the device's SD card with some size. I see you have, but I didn't, so just putting it out there in case anyone else has a similar issue.
Open AVD manager, click on the device you are using... click 'edit' and go to the "SD Card" area. Make sure if "Size" is clicked, that there is a number in the area next to it. Otherwise the SD card can't hold any info.

if some one have same problem in new build of studio . 0.8.9 and above see my solution and it will work like a charm , here : afra mehrparvar solution in the bottom of the page .
Android Emulator sdcard push error: Read-only file system

Related

ADB Install seems to fail (preventing me from debugging on device using Visual Studio)

I use VS2015 with Xamarin to deploy an app to my phone. After recently rooting and wiping my phone data, I'm receiving errors upon deploying. The most common issue was that the "Fast deploy" was enabled, but I already had that turned off.
I figured out that my ADB Install seems to fail (permission denied), giving me the following error:
failed to copy 'x' to '/data/local/tmp/x': Permission denied
It really starts working on my nerves, and after trying several things which I found on the internet, I ended up asking a question here.
When I go to my 'ADB Shell' (running in root mode and showing this # sign), and type 'ls -ld data data/local data/local/tmp'
it shows the following, which seems to be normal (according to things I read):
drwxrwx--x system system 2016-06-26 15:11 data
drwxr-x--x root root 2016-06-26 08:52 local
drwxrwx--x shell shell 2016-06-26 01:58 tmp
I started by recreating the 'tmp' folder, and using 'EF File Explorer' on my phone I can modify things and do everything I'd like to do. (modify rights, add folders, remove folders, recreate the folders and so on).
When I go to 'Root explorer' in EF File Explorer, I changed the '/' folder mode to 'RW', but it didn't make any change. Root explorer says it's still on "r/o" (read only) mode.
I tried the 'busybox mount -o remount, rw /system' trick and other mount-commands which did the trick for others, but still same issue with my phone.
Furthermore, I tried a "move" trick in the shell, which didn't work out either.
As a last option I even tried to do a full format/wipe, but even thát did not solve my issue.
So I'm currently back at square one, where my 'ls -ld' is still showing the same information. Copying files to the internal storage via Windows Explorer works as it should.
Hopefully I'm doing something stupid and is there a fix for this issue. Thanks in advance for your help.

Android Cannot see anything inside data folder

i am trying to see SQLite database in anyway possible (I have a rooted device). I tried File explorer in eclipse but i cannot see anything under data folder. Can anybody please help me with this
I tried to search everywhere but couldnt find a clear solution.
I also tried adb shell but i cannot see list of things inside data folder using "ls" command.
error
Opendir failed. Permission denied
I am guessing this has something to do with rights but how can i fix it
Please help
You need root premission to explore DATA directory...
From phone
I use terminal emulator to do the job..... Simply open terminal then type in su after that it will ask for premision. then you need to type cd data/data/WhereEverYouNeedToGo/databases and "WhereEverYouNeedToGo" should be package name. After that you could do whatever you want with your database.
from PC
open terminal or cmd goto your adb directory then run adb shell then su and then
cd data/data/WhereEverYouNeedToGo/databases
Hope it helped.
Run adb in root mode using "adb root"
adb shell
su
ls /data/
Try this
You have been given a number of answers for how to leverage the root capability, however as android is designed without the assumption of root there are other methods as well which you can use while developing apps.
1) Include functionality on an expert menu to copy the database to the sdcard; there is no file copy method in android java (and in most stock cases no 'cp' shell command), but you can find numerous answers here with a copy routine.
2) Make your apk debuggable and use the run-as command to obtain a shell running as the application userid and starting in the app's data directory. You can then copy the database to the sdcard if the app has that permission.
3) Have your app set the permissions on the database file during development to world readable. Although you cannot browse the directory tree to down to it, you can then adb pull the database file by giving it's full path name.
You need to have either routed device or your device should be a "Android Dev Phone" to explore that directory. Trying checking the same using emulator, you will be able to see the data folder contents.

Eclipse console shows:'Failed to push selection: Read-only file system'when i try to push a file

I am trying to push a file to the SD Card but its showing error in console 'failed to push selection: Read-only file system'.I am using DDMS perspective in Eclipse.I generated sdcard using mksdcard command.
Just go to
C:\Documents and Settings\<adminstrator>\.android\avd
take 'properties' of your avd folder (there is a folder for each of the avd's)
uncheck 'Read only' -> OK
This was the only thing that worked for me.
P.S: Some of these folders might be hidden.
On the Terminal or Command-Prompt, write these( for me its command prompt ):
adb shell(Opens the device shell. you'll see a #)
su(get the root permission, if necessary)
mount -o rw,remount rootfs /(remount the root file system.)
chmod 777 /mnt/sdcard (change the permission of the sdcard to rwe.)
exit
If it doesn't work, try to push the file from the same shell using adb push .
Hope this help.
You need to give SDCard support to your AVD and mount the SDCard.
First go to 'AVD Manager and select your AVD then Click on Edit and in the Hardware add SDCard Support'.
Please check this link for complete detailed step to achieve SDCard support and mounting.
You can also give a try to this command in CMD, this will remount your SDCard.
c:\android-sdk\platform-tools\>adb remount
I was also facing same issue :
Failed to push selection: Read-only file system
In computers with higher configuration(beyond Windows XP)
settings like ---> C:\Documents and Settings\.android\avd
doesn't exist so instead
go to this path --> C:\Users\.android and right click on this folder and uncheck the box having name as read only.
Hope this helps those with newer windows on their pc :) , if this solution helps you than please vote for it.
In my case i have mistake with the slash.
while specifying "Additional Emulator Command Line Options" in eclipse
Actually it should be -sdcard C:/Kamal/sdcard/emulator_sdcard
and i was putting -sdcard C:\Kamal\sdcard\emulator_sdcard
Then after restarting the Eclipse & Emulator it works.
If the data in the sd card is not updated in the emulator or in the app which you are developing then,
Select,
Dev Tools->Media Scanner
The data which has been already pushed into the sd card by variant means will get loaded soon.!
if some one have same problem in new build of studio . 0.8.9 and above see my solution here and it will work like a charm : (afra mehrparvar solution in the bottom of the page )
Android Emulator sdcard push error: Read-only file system

remounting a stubborn sdcard directory back to read-write

I'm developing an application for commercial market that won't be available on Play and I have a specific target device which was custom built, but not by me. Certain 3rd party SDK resources need to be installed in the SDCard directory. That alone is simple to do.
The problem I'm facing is that somehow the sdcard directory has been mounted read-only. Note there isn't really an sdcard, it's a partition on the internal drive. It was actually mount rw at point, something changed and now I'm stuck with read-only sdcard directory.
What I have tried so far:
Tried remounting the sdcard mount point. Hasn't worked. Even if i'm logged in as root. No errors supplied.
mount -o remount,rw /dev/block/mmcblk1p4 /mnt/sdcard
Checked /proc/mounts. I can see there in /proc/mounts that sdcard has been mounted ro. What I don't know is if there's an fstab equivalent in Android so I change the options. I'm told that vold.fstab is where I should go for that but...
/dev/block/mmcblk1p4 /mnt/sdcard vfat ro,relatime,uid=1000,gid=1015,fmask=0202,dmask=0202,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
Checked vold.fstab. That's not the same device shown in /proc/mount.
dev_mount sdcard /mnt/sdcard 4 /devices/platform/mmci-omap-hs.1/mmc_host/mmc1
dev_mount usbdisk /mnt/sdcard/usbdisk auto /devices/platform/ehci-omap.0
dev_mount extsd /mnt/sdcard/extsd auto /devices/platform/mmci-omap-hs.0/mmc_host/mmc0
Checked logcat output from boot. Nothing to indicate there was an error for mounting, but then I'm not even sure if mount/vold would report to logcat. There were however a number of errors that indicated booting applications couldn't write to sdcard.
I'm super confused at this point. Does anyone know of a sure fire way to fix this?
EDIT:
I've tried different mount options this time
mount -w -o remount /dev/block/mmcblk1p4 /mnt/sdcard
This works for awhile, and I'm able to do a few file operations but It eventually reverts back to RO, almost within a couple of minutes.
Managed to solve the problem. The file system had been corrupted thus the system forced remount to read-only. The simple fix was to recreate the file system.
admittedly this wasn't on android but i had to install ntfs-3g and configure fstab thus:
/dev/sda1 /media/mycard ntfs-3g rw,umask=0000,defaults 0 0
or mount with
mount -t cifs -o uid=1000 /dev/sda1 /media/mycard

How I can push file onto Android Device (NexusS) using eclipse or adb?

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 !

Categories

Resources