adb run-as复制文件
我有可拆除的应用程序,我需要将文件复制到电话,然后返回。我使用此命令并接收错误。
adb shell run-as app cp /data/data/app/shared_prefs/app_preferences.xml /storage/emulated/0
cp: /storage/emulated/0/app_preferences.xml: Operation not permitted
我尝试编辑文件
adb shell run-as app "echo test > /data/user/0/app/shared_prefs/app_preferences.xml"
/system/bin/sh: can't create /data/data/app/shared_prefs/app_preferences.xml: Permission denied
,但是如果我尝试使用
adb shell
run-as app
echo test > /data/user/0/app/shared_prefs/app_preferences.xml
这种方式,则可以编辑文件,但cp却没有。另外,通过Android Studio,我可以保存和上传文件。
总的来说,如何在一个命令中编辑或复制文件?
I have debbugable app, and I need to copy file to phone, and back after. I use this command and receive error.
adb shell run-as app cp /data/data/app/shared_prefs/app_preferences.xml /storage/emulated/0
cp: /storage/emulated/0/app_preferences.xml: Operation not permitted
I tryied to edit file
adb shell run-as app "echo test > /data/user/0/app/shared_prefs/app_preferences.xml"
/system/bin/sh: can't create /data/data/app/shared_prefs/app_preferences.xml: Permission denied
But if I try
adb shell
run-as app
echo test > /data/user/0/app/shared_prefs/app_preferences.xml
This way I able to edit file, but cp not. Also via Android Studio I can save and upload file.
In total, how to edit in one command or copy file?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论