adb remount permission denied, but able to access super user in shell -- android
In case anyone has the same problem in the future:
$ adb shell
$ su
# mount -o rw,remount /system
Both adb remount
and adb root
don't work on a production build without altering ro.secure, but you can still remount /system by opening a shell, asking for root permissions and typing the mount command.
Android: adb: Permission Denied
According to adb help
:
adb root - restarts the adbd daemon with root permissions
Which indeed resolved the issue for me.
adb shell su, not getting root permission
Solved. I tried it on my other phone and it was due to the superuser app popping up a notification to allow the computer root access, sadly I could not see the popup and tap it on the phone with a broken screen
ADB getting a permission denied despite running as root
The sdcard is mounted with a noexec flag, which means you cannot execute things stored there.
This is doubly important when running as root or even the semi privileged shell, since the lack of file permissions or ownership there means any userid with the write external storage permission could trojanize the program you might want to run.
As an aside the default shell has a limited vocabulary of errors and in many versions will also say permission denied as a substitute for command not found. Your current working directory is not in the search path, so if you want to run something from there, you typically need to do:
./filename
android adb shell permission denied
If the device hasn't crashed completely (/system/bin/sh is a dependency for a lot of things - rebooting may not get very far!) and the system partition is still writable, you might be able to adb push a new copy of bash, where you have set the permission bits as desired on the host system before pushing it (you may have to use cygwin or even linux in order to have permission bits locally)
It sounds like the device is rooted, so you might be able to configure or customize a terminal emulator app to give you a session using the backup sh, run the backup sh again as root using some escalation tool, and then fix the problem.
If you have a modified recovery with adb, you could probably fix it from there by mounting the (normal) system partition manually.
Last resort would restoring from a vendor-signed vanilla image.
Hopefully you get un-stuck, but perhaps you've learned from this experience - changing the default shell is probably not a good idea. It would be better to load your custom shell under a different name and run it manually.
Related Topics
How to Kill Sub Activities and Bring Activity to Top of Stack
Android How to Replace the Deprecated Tabhost
Android: How to Track Down the Origin of a Inflateexception
Passing Bitmap Between Two Activities
Android Fragments: When to Use Hide/Show or Add/Remove/Replace
Start Activity with an Animation
How to Retrieve Key Alias and Key Password for Signed APK in Android Studio(Migrated from Eclipse)
Users Does Not Define No Argument Constructor
Android Custom View Group Delegate Addview
Initiate a Phone Call on Android with Special Character #
How to Extract Code of .Apk File Which Is Not Working
Tab Not Taking Full Width on Tablet Device [Using Android.Support.Design.Widget.Tablayout]
Android App Enable Nfc Only for One Activity
How to Restart Adb Manually from Android Studio
[Install_Failed_No_Matching_Abis: Failed to Extract Native Libraries, Res=-113]
How to Get Current Sim Card Number in Android
Simple Httpurlconnection Post File Multipart/Form-Data from Android to Google Blobstore