问题描述
我正在尝试测试我的应用程序由于缺少权限而无法访问某些文件时的行为.
I'm trying to test the behavior of my application when it cannot access some files due to missing permissions.
是否可以在 DDMS 透视图中使用 FileExplorer 更改 Android 模拟器上的文件/文件夹权限?
Is it possible to change file/folder permissions on an android emulator using FileExplorer in DDMS perspective?
推荐答案
要更改模拟器中的权限,您需要使用您的 adroid-sdk 平台工具中的 adb shell 命令.在 android shell 中,您可以输入命令 su 以获取 root 访问权限.现在您可以使用普通的 unix 命令 chmod
To change permissions in the emulator you need to use the adb shell command from your adroid-sdk platform-tools. In the android shell you can enter the command su to get root access. Now you can see and change the permissions with the normal unix commands chmod
注意,Android中的系统文件夹是只读挂载的.在本教程之后,您必须将其以读写方式移除:
Note, that the system folder in Android is mounted read-only. You would have to remout it read-write after this tutorial:
http://android-tricks.blogspot.com/2009/01/mount-filesystem-read-write.html
无论如何都要小心,仅将 /data 或 sdcard 等可写文件系统用于您的应用程序数据,因为使用受限文件夹可能会在生产环境中产生负面影响!
Be careful in anyway to use only writable filesystems like /data or sdcardfor your application data since using restricted folders can have negative side effects in a productive environment!
这篇关于在 DDMS (Android) 中更改文件权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!


大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)