问题
- I want to create the file in android system folder.
I have also tried this "mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system" using Runtime.getRuntime().exec() but it's not working.
if you have example please let me know. Thanks
回答1:
Android applications don't run as root
on an unmodified device so they can't write to the /system
folder or remount file systems.
Why do you want to write to /system
? What's wrong the the storage directory for you app?
This may be possible on a "rooted" Android device but this rules out the majority of users.
回答2:
//if its showing as $ you need to root your phone
padmakumar@padmakumar-desktop:~$ adb shell
$
//if its showing as # you can copy files
padmakumar@padmakumar-desktop:~$ adb shell
#
//let do this step
padmakumar@padmakumar-desktop:~$ adb root
padmakumar@padmakumar-desktop:~$ adb remount
//push a file from you system to your phone
adb push ./Desktop/my_lib.so /system/lib
来源:https://stackoverflow.com/questions/9736708/how-to-r-w-file-in-android-system-directory-internal-storage