我正在尝试使用 os.system 在一行中执行以下一系列 adb 命令:
OnePlus5:/ $ su
OnePlus5:/ # cd data/data && chmod -R 777 ./
chmod: chmod 'lib' to 120777: Read-only file system
chmod: chmod 'lib' to 120777: Read-only file system
chmod: chmod 'lib' to 120777: No such file or directory
chmod: chmod 'lib' to 120777: Read-only file system
chmod: chmod 'lib' to 120777: Read-only file system
chmod: chmod 'lib' to 120777: Read-only file system
chmod: chmod 'lib' to 120777: Read-only file system
chmod: chmod 'lib' to 120777: Read-only file system
1|OnePlus5:/data/data # exit
1|OnePlus5:/ $ exit
这是我的 Python 脚本中应该执行此操作的行:
os.system("adb shell su -c 'cd /data/data && chmod -R 777 ./; exit' && exit")
这是控制台中与此行相关的两行:
su: exec failed for cd Error:No such file or directory
adb: error: failed to copy '/data/data/xxxxxx' to './xxxxx': remote open failed: Permission denied
然后我需要在数据/数据文件夹中的文件夹中提取一个特定文件,该文件夹具有之前使用
adb pull
给出的新权限,但我不能像上面看到的那样做。
帮助将不胜感激!