I ran the following command and the phone automatically rebooted after copying. Why? Was it because the so file was in use?

$ adb shell 'mount -o rw,remount /system && cp /sdcard/libfoo.so /system/lib'

My phone is rooted and enters as root when issued the adb shell command. My Android version is 5.1.

I also tried the following commands and the phone still restarted.

$ adb remount
remount succeeded
$ adb shell 'cp /sdcard/libfoo.so /system/lib'
  • What's your Android version and model ? ... sometimes it can be caused by a protection measure that protects the system partition from modifications, it's now why new root programs use "systemless root". You still have the ability to modify some aspects of the system, but changing files in specific directories can cause problems, this is because systemless root is still in the development stage and has many issue's still. – Gadget Guru Nov 17 '18 at 20:42

If you don't want the phone to reboot, push the so file directly to the system/lib folder. Don't make the sdcard folder an intermediary. So you do:

$ adb remount
$ adb push libfoo.so /system/lib
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.