sudo是* nix实用程序,而不是在Windows上可以找到的东西。同上chmod。
即便如此,有问题的命令只是使用简单的位掩码调整项目文件夹的权限。从chmod man page:
-R, --recursive change files and directories recursively
Numeric mode:
From one to four octal digits
Any omitted digits are assumed to be leading zeros.
The first digit = selects attributes for the set user ID (4) and set group ID (2) and save text image (1)S
The second digit = permissions for the user who owns the file: read (4), write (2), and execute (1)
The third digit = permissions for other users in the file's group: read (4), write (2), and execute (1)
The fourth digit = permissions for other users NOT in the file's group: read (4), write (2), and execute (1)
The octal (0-7) value is calculated by adding up the values for each digit
在您的命令,第一个数字是缺少这样被假定为0。第二,第三和第四被7,其转换成读/写/执行用于目录所有者访问,文件组中的任何其他人以及文件组中的其他人而不是。 -R开关递归地将这些权限应用于/ your/project /路径内的每个文件和文件夹。
在Windows上,等价命令在资源管理器中。导航到/ your/project(而不是/ your/project/path)并右键单击/路径。选择Properties,会出现一个属性对话框。切换到该对话框中的Security选项卡。
从这里,有几种方法可以做到这一点。您只需点击Group or user names列表中的用户帐户,点击列表底部的Edit按钮,然后给自己任何缺失的权限。
若要进行更彻底的权限调整,包括您的sudo命令给出的递归,请选择Advanced而不是Edit。将出现一个新对话框Advanced Security Settings for /path。按Change Permissions。相同的对话框将重新出现,但Change Permissions将被替换为Add按钮和Edit按钮。底部将出现一个标记为Replace all child object permissions with inheritable permissions from this object的复选框。确保检查 - 这是-R。现在从列表中选择您的用户名并选择Edit。检查每个复选框并点击OK。一直保持击中OK退出对话框。有足够的运气来解决你的权限问题。
如果您想要更简单的修复,请以管理员身份运行Android Studio,as suggested by the accepted answer in your question。与手动调整权限相比,这种方式不太可能破坏事情,并且通常足以解决与权限相关的问题。
另外值得注意的是,接受的答案建议确保您对android-sdk和Android Studio目录具有写入权限。只有sudo答案建议调整/ your/project/path的权限。为了答案的目的,我将重点放在了你所问的命令的Windows上;您可能想要在android-sdk和Android Studio上执行类似的特权调整,而不仅仅是/ your/project/path。
最后,请务必Android的SDK未安装到%ProgramFiles%,为write access can be a problem there:
Click Start > All Programs > Accessories , right-click Notepad , and click Run as administrator . For protection against malware, Windows 7 doesn't allow normal processes to change files in the Program Files folder.
的Android Studio可以安全地安装在那里,但Android的SDK不能。