一个根深蒂固的Andr​​oid终端命令重新挂载/系统的读/写 [英] A terminal command for a rooted Android to remount /System as read/write

查看:152
本文介绍了一个根深蒂固的Andr​​oid终端命令重新挂载/系统的读/写的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在写一个Android应用程序,需要将文件复制到/系统分区的运行。我已经得到了命令,运行苏,可以成功地要求超级用户权限,并执行命令的根。但我不知道如何使在多个设备上这个应用普遍,因为mount命令可以根据其中/系统实际安装的有所不同。这里是一个的使用最多offen命令:

I'm writing an android app that needs to copy a file to the "/system" partition at runtime. I've got the commands to run "su" and can successfully request SuperUser permissions and run commands as root. But I don't know how to make this app universal across multiple devices, because the mount command can differ depending on where the /system is actually mounted. Here's the command that's used most offen:

mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system

但我知道,mtdblock3可能是在某些设备上不同的(对于这个问题,我想这样可以YAFFS2)。所以,我的问题是:是否有一个,将工作在所有的手机都通用的命令?还是有办法找出在运行时什么是正确的参数?

But I know that mtdblock3 could be different on some devices (and for that matter, i guess so could yaffs2). So, my question is: Is there a universal command that will work on all phones? Or is there a way to find out at runtime what the correct parameters are?

推荐答案

您可以运行的安装的命令,而不为了构建你的mount命令之前得到分区信息参数。这里是不带参数的mount命令从我的HTC Hero所输出的一个例子。

You can run the mount command without parameter in order to get partition information before constructing your mount command. Here is an example of the mount command without parameter outputed from my HTC Hero.

$ mount
mount
rootfs / rootfs ro 0 0
tmpfs /dev tmpfs rw,mode=755 0 0
devpts /dev/pts devpts rw,mode=600 0 0
proc /proc proc rw 0 0
sysfs /sys sysfs rw 0 0
tmpfs /sqlite_stmt_journals tmpfs rw,size=4096k 0 0
none /dev/cpuctl cgroup rw,cpu 0 0
/dev/block/mtdblock3 /system yaffs2 rw 0 0
/dev/block/mtdblock5 /data yaffs2 rw,nosuid,nodev 0 0
/dev/block/mtdblock4 /cache yaffs2 rw,nosuid,nodev 0 0
/dev/block//vold/179:1 /sdcard vfat rw,dirsync,nosuid,nodev,noexec,uid=1000,gid=
1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,s
hortname=mixed,utf8,errors=remount-ro 0 0

这篇关于一个根深蒂固的Andr​​oid终端命令重新挂载/系统的读/写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆