Why did my phone reboot after copying an so file to the system/lib folder? 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 &amp;&amp; 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'
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