Moving files to SDcard on Android - android

How do I put a file onto an sdcard using command line? I tried by using the adb push command but it's not working. My file is in D:/sample.ogg. I have written:
adb push sample.ogg/sdcard/sample.ogg
It's not working. Any help would be appreciated
Thanks

In Command prompt type the following...
mksdcard -l test 10M c:/test1.img
try starting the emulator and loading the SDcard from command prompt by typing...
emulator -sdcard c:/test1.img
once emulator is started open another command prompt instance and try copying a file to SDcard by typing
adb push e:/test.png sdcard/test.png
Later try retrieving the same file from sdcard to your system by typing
adb pull sdcard/test.png d:/
see if the file has been copied in your d:/ ..try and tell me if it works for u:)
You can check my post here
http://www.anddev.org/error_while_writing_on_sdcard-t2997.html?sid=c01c1a23f34eb6bb7f97b6af99ca9816
Edit--
In the newer Android SDK's you can directly create an SD Card and start your emulator from your AVD in eclipse. You can neglect step 1 and 2 in that case and try push and pull commands directly
In your case it should be
adb push d:/sample.ogg sdcard/sample.ogg

Related

Problem with adb push command read-only file system

I am trying to copy a file via cmd Windows 7 to a Samsung Tablet but I get the following message:
remote could not create the file.Read-only system.
Why does it happen? How can I remove it? I execute the command adb list devices and my tablet appears normally, but I cannot copy the file adb push filename /Sdcard/Android/etc.

Android Studio - Android Device Monitor's File explorer not working

I have just learnt using preferences in Android. For debugging purpose I need to access the preferences files. I googled and found the default location of the preference file and also how to access it via Android Device Monitor.
Somehow I am not able to open any folders under the File explorer tab of the Android device monitor. They just aren't responding. I tried waiting for ADM to load and tried again but no success. (Double click on folder is not working, STRANGE!)
Do we need to configure before using it? I am using Android studio.
Any help would be appreciated.
Attaching image
Finally I found how to make it work.
goto run -> location where your adb is
Ex: C:\Program Files (x86)\Android\android-sdk\platform-tools
type adb root , Enter (Your phone must have root)
If this doesn't work, install this app on your phone: [root] adbd Insecure or its free alternative here (update: link broken now).
Get more info at http://forum.xda-developers.com/showthread.php?t=1687590
You will need either to use the emulator or to have a rooted phone to use all functionalities.
Root your device and open adb shell and change the permissions as:
$ adb shell
$ su
1|root#android:/ # chmod -R 777 data/

Pull database from Genymotion emulator

I am using Windows7 and want to extract/pull the application database to the local windows machine's folder.
I have searched through internet and found the adb command as below :
adb shell su 0 cp /data/data/<package.name>/databases/<database.name> /mnt/shared/
I have tried the same by creating shared folder for the Virtual box.
But getting error is like : read-only file system
I have also check that read-only is disabled.
Please I need help.
Screenshots :
I'm not sure for Windows but on Mac you just call
adb pull /data/data/<package.name>/database/<database.name> <local.file.path>
As your phone under Genymotion is rooted, you can go in the DDMS of Eclipse.
Then, Click on the tab file explorer.
Then go to folder /data/data/<your.package.name>/ then pull the file from the path in which you saved your database.

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

I want to read a local text file on my computer on an Android Emulator

How can I put that file in userdata.img so that the emulator can read it? Also, how can to specifiy the path of the file in the code? I am using Windows 7.
To push a file onto the emulator or any other rooted device you'd just issue a adb push command.
adb push FILE PATH_ON_DEVICE
In Java to define the path to a file you can simply create a File object with the path set in its constructor.
File file = new File("/path/on/device");
You can use adb to push the file to whatever location you want. Just start the emulator (without any device connected) and type
adb push myfile /mylocation/myfile
Here is the manual page for the commands: http://developer.android.com/guide/developing/tools/adb.html
Alternatively, you can browse the file system using ddms

Categories

Resources