简体   繁体   English

使用adb shell重命名文件

[英]renaming files using adb shell

I want to rename a file on my android device (running CyanogenMod 11) using the adb shell. 我想使用adb shell重命名我的android设备上的文件(运行CyanogenMod 11)。 I have access to the phone via adb, but when I go to the directory where the file is located and try to rename it with mv ./file.old ./file.new I get mv ./file.old failed, Read-only file system . 我可以通过adb访问电话,但是当我转到文件所在的目录并尝试使用mv ./file.old ./file.new重命名该文件时,我得到mv ./file.old failed, Read-only file system Tried the same with su but then I get /system/bin/sh: su: not found su尝试相同,但随后得到/system/bin/sh: su: not found

Do I need to change something on my phone or somewhere else? 我需要在手机上或其他地方进行更改吗?

You should first mount system as rw 您应该首先将system安装为rw

su
mount -o remount,rw /system
mv ./file.old ./file.new

First, You cannot rename system file directly, if it's a system file, you'll need superuser permission and you'll have to make the file system read-write. 首先,您不能直接重命名系统文件,如果它是系统文件,则需要超级用户权限,并且必须使文件系统具有读写权限。 Second, Look on your phone as soon as you type su and Grant permission from phone. 其次,在您键入su并从电话授予权限后立即查看您的电话。

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

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