How to R/W file in android system directory (Internal Storage)

▼魔方 西西 提交于 2019-12-12 04:49:43

问题


  • 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!