我该如何在Kindle Fire上更改/mnt/SDcard文件夹的读/写权限?

6

我正在尝试开发Android上的Amazon In-app。为此,我从此网站下载了示例代码。本文建议我们将文件amazon.sdktester.json放在设备的mnt/sdkcard文件夹中。因此,我从此网站阅读了文章并执行了相同的操作。但是当我试图将文件推送到sdcard时,eclipse会给我以下错误:

[2012-11-19 13:39:39 - ddms] transfer error: Permission denied

[2012-11-19 13:39:39] Failed to push selection: Permission denied

有没有办法更改Kindle Fire的根文件夹的权限?
1个回答

6

请尝试在ADB shell中使用chmod命令...

以下是一些chmod示例:

  1. Add single permission to a file/directory

Changing permission to a single set. + symbol means adding permission. For example, do the following to give execute permission for the user irrespective of anything else:

$ chmod u+x filename
  1. Add multiple permission to a file/directory

Use comma to separate the multiple permission sets as shown below.

$ chmod u+r,g+x filename

  1. Remove permission from a file/directory

Following example removes read and write permission for the user.

$ chmod u-rx filename

  1. Change permission for all roles on a file/directory

Following example assigns execute privilege to user, group and others (basically anybody can execute this file).

$ chmod a+x filename

  1. Make permission for a file same as another file (using reference)

If you want to change a file permission same as another file, use the reference option as shown below. In this example, file2′s permission will be set exactly same as file1′s permission.

$ chmod --reference=file1 file2

  1. Apply the permission to all the files under a directory recursively

Use option -R to change the permission recursively as shown below.

$ chmod -R 755 directory-name/

  1. Change execute permission only on the directories (files are not affected)

On a particular directory if you have multiple sub-directories and files, the following command will assign execute permission only to all the sub-directories in the current directory (not the files in the current directory).

$ chmod u+X *


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接