Change file permissions in DDMS (Android)

情到浓时终转凉″ 提交于 2019-11-28 02:00:53

问题


I'm trying to test the behavior of my application when it cannot access some files due to missing permissions.

Is it possible to change file/folder permissions on an android emulator using FileExplorer in DDMS perspective?


回答1:


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

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

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!



来源:https://stackoverflow.com/questions/7473573/change-file-permissions-in-ddms-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!