Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I remount my Android/system as read-write in a bash script using adb?

For info

adb remount  

returns "remount failed: Operation not permitted"

adb shell 'su -c  mount -o rw,remount /system' 

returns unknown option -- o

My device is rooted.

like image 508
Andrew Avatar asked Jan 18 '15 12:01

Andrew


Video Answer


1 Answers

Probable cause that remount fails is you are not running adb as root.

Shell Script should be as follow.

# Script to mount Android Device as read/write. # List the Devices. adb devices;  # Run adb as root (Needs root access). adb root;  # Since you're running as root su is not required adb shell mount -o rw,remount /; 

If this fails, you could try the below:

# List the Devices. adb devices;  # Run adb as root adb root;  adb remount; adb shell su -c "mount -o rw,remount /"; 

To find which user you are:

$ adb shell whoami 
like image 145
Saurabh Meshram Avatar answered Oct 23 '22 14:10

Saurabh Meshram