更改DDMS文件权限(安卓) [英] Change file permissions in DDMS (Android)
问题描述
我想测试我的应用程序的行为,当它不能访问某些文件由于缺少权限。
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平台亚行外壳
命令-tools。在Android的外壳,你可以输入命令苏
来获得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
注意,在安卓系统文件夹中安装只读的。你将不得不REMOUT这本教程之后读 - 写:
Note, that the system folder in Android is mounted read-only. You would have to remout it read-write after this tutorial:
<一个href="http://android-tricks.blogspot.com/2009/01/mount-filesystem-read-write.html">http://android-tricks.blogspot.com/2009/01/mount-filesystem-read-write.html
小心反正只使用可写的文件系统,如 /数据
或 SD卡
为您的应用程序数据,因为使用受限制文件夹可以在生产环境的负面影响!
Be careful in anyway to use only writable filesystems like /data
or sdcard
for your application data since using restricted folders can have negative side effects in a productive environment!
这篇关于更改DDMS文件权限(安卓)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!