How can I use ADB shell to mount sdcard - android

I have Xperia S and I have already installed cwm recovery.
I need to use recovery to backup,restore or flash roms from my sdcard.
But every time I have the problem:"E:can'not mount /sdcard".
I have tried to mount it using adb using :
adb shell
su
mount -o mnt/sdcard
I still have the problem.
Can someone help me to use adb correctly to solve the problem or have any better idea.
Thanks

Try to see if this thread on XDA fix your problem.

Related

How to make system partition in AVD in emulator writable

This is fairly a very old question but I am surprised that none of the solutions are working for me. I need to run an android app as system app in an AVD (in emulator) created for Android version 7.0. For this, I want to push apk file to system partition but I keep getting error saying it is read only file system. I found many similar questions on stackoverflow but nothing is working for me. I restarted adb in root, executed it with remount as suggested in answers to similar questions, but system partition file system permissions do not change. Here is a sample session:
mvsagar#mvslt:~/sw/android_sdk/platform-tools$ ./adb root
restarting adbd as root
mvsagar#mvslt:~/sw/android_sdk/platform-tools$ ./adb remount
remount succeeded
mvsagar#mvslt:~/sw/android_sdk/platform-tools$ ./adb push /home/mvsagar/projects/AndroidStudioProjects/LcnApps/app/LCNUE.apk /system/app/LCNUE.apk
adb: error: failed to copy '/home/mvsagar/projects/AndroidStudioProjects/LcnApps/app/LCNUE.apk' to '/system/app/LCNUE.apk': couldn't create file: Read-only file system
I have tried manually remounting with read/write(rw) options using adb shell, but the remounting fails.
Is there any way to have read/write permission on system partition?
My dev env is Android Studio on Ubuntu.
In my case, I use a avd( Based on: Android 8.0 (Oreo) Tag/ABI: google_apis/x86_64 ).
$ emulator -avd Nexus_5X_API_26_APIs -writable-system
$ adb root
$ adb remount
Then, /system is writeable.
$ adb push somefile /system/bin/ is work.
When working with Q, this is the only solution that worked for me: https://stackoverflow.com/a/64397712/1898527
Adding here the steps for completion (kudos to the original author):
> emulator -avd Pixel_3a_XL_API_29 -writable-system
> adb shell avbctl disable-verification
> adb disable-verity
Now reboot your emulator so that the changes take effect.
> adb root
> adb remount
> adb shell "su 0 mount -o rw,remount /system"
Note: you will need an emulator without Google Play, otherwise this won't work. You can get it by following the steps described here: https://stackoverflow.com/a/45668555/1898527
use genymotion emulator, which is faster, light weight and pre rooted. (which means you can access system directory)
For the benefit of others, answer to the question was answered a long ago by #Ishamael in another stackoverflow question Read only file system on Android

ADB apk installation error "INSTALL_FAILED_INVALID_URI"

I use ADB tool and I want to install apk on my emulator. So I use this command
adb install /home/jody/myexample.apk
and I got this error
2841 KB/s (242867 bytes in 0.083s)
pkg: apk
ver: /data/local/tmp/concolicexample.apk
Failure [INSTALL_FAILED_INVALID_URI]
I search this error and from https://mobiledevstories.wordpress.com/2013/06/03/android-adb-install_failed_invalid_uri/ I found out I should The solution is to change permissions to directory but the problem is I don't know where is /data/local/tmp and where should I change permissions?
I should mention that I use genymotion emulator on Linux.
please help me. Sorry if this problem is really primitive. I just begin to use adb.
There are more people with your problem here:
Cannot install package on rooted device : INSTALL_FAILED_INVALID_URI
I think that your device needs to be rooted for this to work, or you won't have sufficient rights. I don't have a rooted device here so don't remember if all steps are necessary:
So the /data/local/ directory is on the Android device, so using adb you need to access the device.
1) adb remount (This might not be necessary, this gives you more access rights to the device)
2) adb shell <- opens a shell on the device instead of your computer.
3) chmod 777 /data/local/
4) chmod 777 /data/local/tmp/
Hopefully it works for you!

how to change permission of DDMS / File Explorer / sdcard?

My sdcard permission is now d---------. How to change the sdcard permission as drwxrwxrwx. I need help. Please give me any one answer. Thanks.
Go to android sdk Manager and cllck edit button on your current emulator.check whether you mention the sdcard memory
commands..
$ adb shell
$ su
$ mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
Try this and let me know what happen..
go to Android virtual Device manager->Edit->Hardware->new->sdcard support
You need be root to acheive this. If you need it in emulator grab a rooted emulator , you can find one here.Then you can use the Terminal Emulator for giving permission or if you don't want to write any command just install the rootexplorer app and use it for giving permission.

Change file permission:/system/etc/bluetooth/audio.config

I use a Samsung Dart - SGH-T499 with Android v2.2.2 on it.
Now I need to edit the /system/etc/bluetooth/audio.config file. For that I rooted my phone using the SuperOneClickv2.3.3-ShortFuse. And browsed the file-system using Root Explorer. But I am unable to edit the permission of the audio.config. Could you please help me?
You also need to ensure that the /system directory, as it's a filesystem, is mounted read-write. In the adb shell use -o rw,remount as parameters to the mount command to do this. First you need to determine what ( hardware / physical / logical ) device that particular filesystem is stored on - use the mount command on its own to see the list and select the one which has /system as its mount point.
Can you not issue a
chmod 777 /system/etc/bluetooth/audio.config
...from the adb shell?

/dev/log/main not found

I'm trying to develop an Android application but when I try to connect to logcat I get the following error:
Unable to open log device '/dev/log/main': No such file or directory
I already installed a new SDK, rebooted my phone... nothing seems to solve the problem. Anyone has any solution?
Samsung Galaxy S (Darky's v9.1)
Apple OSX
ADB 1.0.26
I had used the Speedmod kernel; This has default Logging disabled. Re-enabled it in the TWEAKS menu.
Thanks for making me realise this Octavian Damiean
I found the following method on XDA:
adb shell
su
mount -o remount,rw /system
echo ANDROIDLOGGER >> /system/etc/tweaks.conf
mount -o remount,ro /system
and reboot.
For a rooted Galaxy Note 7000, run insmod /lib/modules/logger.ko in the shell (this is missing from the rootfs' init.rc), assuming you can boot up sufficiently far to access adb / some terminal like terminal-ide. The module mounts in /dev/log and provides the missing files.

Categories

Resources