使用adb pull复制数据库文件导致“权限被拒绝”错误 [英] copy db file with adb pull results in 'permission denied' error
问题描述
我刚刚使用以下方法扎根了Nexus 5: http: //www.phonearena.com/news/How-to-root-Google-Nexus-5_id49014
I just rooted my Nexus 5 using this method: http://www.phonearena.com/news/How-to-root-Google-Nexus-5_id49014
我还在开发人员选项中启用了USB调试功能。
I also enabled USB debugging in the developer options.
然后我尝试使用以下命令从设备中提取数据库文件:
Then I tried to pull a database file from my device using this command:
adb pull /data/data/path.to.package/databases/data /sdcard/test
我得到权限被拒绝
错误。
我在该应用中没有设置调试标志试图访问。这是我无法访问该文件的原因吗?如果是,是否有任何变通办法来访问应用程序文件?
I don't have the debugged flag set in that app I tried to access. Is that the reason I can't access that file? If yes, are there any workarounds to access an apps files?
推荐答案
您可以使用 run-as
shell命令访问私有应用程序数据。
You can use run-as
shell command to access private application data.
如果只想复制数据库,则可以使用
< a href = https://stackoverflow.com/a/31504263/998157> https://stackoverflow.com/a/31504263/998157
If you only want to copy database you can use this snippet, provided in https://stackoverflow.com/a/31504263/998157
adb -d shell "run-as com.example.test cat /data/data/com.example.test/databases/data.db" > data.db
这篇关于使用adb pull复制数据库文件导致“权限被拒绝”错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!