1. adb shell
2. cd sdcard/abc/config/
3. 导出文件:adb pull /data/abc/config/
4. start . 打开当前的文件位置找到abc.conf文件
5. 修改内容
6. adb push d:\abc.conf /data/abc/config/
7. adb shell
8. cat /data/abc/config/abc.conf 检查配置文件是否更新
9. sync 保存一次
执行第6步:adb push d:\abc.conf /data/abc/config/
若报错:failed to copy '' to '': Is a directory
则应 adb push d:\abc.conf /data/abc/config/abc.conf
ps:
public static String getRootPath() {
if (Environment.MEDIA_MOUNTED
.equals(Environment.getExternalStorageState())) {
rootPath = Environment.getExternalStorageDirectory()
.getAbsolutePath().toString();
Log.d(TAG, "getRootPath: rootPath = " + rootPath);
} else {
rootPath = "/data/data/";
}
return rootPath;
}
由getRootPath()得到的路径为:/storage/emulated/0/xxx/xxxx
映射到真实路径为:sdcard/xxx/xxx
其他:
通过ls查看文件属性
单个文件: ls -l 文件名
全部文件: ls -l
本文详细介绍了使用ADB工具进行文件操作的方法,包括如何通过adbshell、adb pull和adb push命令导出和更新设备上的配置文件,以及如何检查配置文件是否已成功更新。
1882

被折叠的 条评论
为什么被折叠?



