简体   繁体   English

如何在android系统目录(内部存储)中读写文件

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

  • I want to create the file in android system folder. 我想在android系统文件夹中创建文件。
  • I have also tried this "mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system" using Runtime.getRuntime().exec() but it's not working. 我也尝试使用Runtime.getRuntime()。exec()来尝试“挂载-o rw,重新挂载-t yaffs2 / dev / block / mtdblock3 / system”,但是它不起作用。

    if you have example please let me know. 如果您有示例,请告诉我。 Thanks 谢谢

Android applications don't run as root on an unmodified device so they can't write to the /system folder or remount file systems. Android应用程序无法在未经修改的设备上以root身份运行,因此它们无法写入/system文件夹或重新挂载文件系统。

Why do you want to write to /system ? 为什么要写到/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. 在“ rooted” Android设备上可能会这样做,但这排除了大多数用户。

//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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM