简体   繁体   English

从Java程序运行时ADB权限被拒绝

[英]Adb permission denied when run from Java program

I'm trying to run chimpchat from Java code and I get this error: 我正在尝试从Java代码运行chimpchat,但出现此错误:

Unexpected exception 'Cannot run program "/home/asco/adt-bundle-linux-x86_64/sdk/platform-tools": error=13, Permission denied' while attempting to get adb version from '/home/asco/adt-bundle-linux-x86_64/sdk/platform-tools 意外的异常“无法运行程序” / home / asco / adt-bundle-linux-x86_64 / sdk / platform-tools”:错误= 13,权限被拒绝',尝试从'/ home / asco / adt-bundle获取ADB版本-linux-x86_64 / sdk / platform-tools

I can run adb from the shell as a normal user. 我可以以普通用户身份从Shell运行adb。 I've chmod 777 'ed the adb program. 我已经用chmod 777编辑了adb程序。 What can I do? 我能做什么? I run Linux Mint 14 (64bit) (have ia32-libs installed) and use java7-openjdk-amd64 . 我运行Linux Mint 14(64位)(已安装ia32-libs)并使用java7-openjdk-amd64

When I tried to open the Android SDK from Eclipse I also received the error 当我尝试从Eclipse打开Android SDK时,我也收到错误消息

"...Permission denied' while attempting to get adb version from '..." “ ...权限被拒绝,而试图从中获取adb版本。”

initially, I tried 最初,我尝试

sudo apt-get install ia32-libs sudo apt-get安装ia32-libs

but it did not fix the problem. 但这并不能解决问题。 i had them already. 我已经有他们了。

What fixed the problem was 解决问题的是

sudo chmod -R 777 /name-of-root-directory-containing-SDK 须藤chmod -R 777 /包含根目录的名称-SDK

Recommendation! 建议! Place SDK, JDK and all other manually installed non-system resources in their own root directory. 将SDK,JDK和所有其他手动安装的非系统资源放在其自己的根目录中。 [ example: /resource ] Permissions set on this directory make no change to any critical files. [示例:/ resource]在此目录上设置的权限不会更改任何关键文件。

Warning! 警告! Erroneous use of chmod -R on system directories can lead to "must reinstall OS from scratch" 在系统目录上错误地使用chmod -R可能导致“必须从头开始重新安装操作系统”

it then complains about not finding the adb program 然后抱怨没有找到adb程序

you need to install ia32-libs package: 您需要安装ia32-libs软件包:

sudo apt-get install ia32-libs

The error is specifying the directory that contains adb, rather than the adb executable itself. 错误是指定包含adb的目录,而不是adb可执行文件本身。 Check the permissions on the directory, and that your program is attempting to run the proper command (it may be trying to run the directory, which clearly won't work...). 检查目录的权限,并且您的程序正在尝试运行正确的命令(它可能正在尝试运行目录,这显然不起作用...)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法运行程序“adb”:错误=13,权限被拒绝 - Cannot run program "adb": error=13, Permission denied 从crontab运行的Java程序的日志结果[权限被拒绝] - log result of java program that run from crontab [ Permission denied ] 在java程序中权限被拒绝的问题 - Permission denied issue in a java program java.io.IOException:无法运行程序adb.exe CreateProcess error = 5,拒绝访问 - java.io.IOException: Cannot run program adb.exe CreateProcess error=5, Access is denied 尝试在 Mac 上通过 Java 运行应用程序时权限被拒绝 - Permission denied when trying to run app through Java on Mac 尝试运行简单的 Java 程序时拒绝访问 - Access Denied when trying to run simple Java program W/System.err:java.io.IOException:无法运行程序“python”:错误=13,权限被拒绝 - W/System.err: java.io.IOException: Cannot run program "python": error=13, Permission denied 在使用tomcat for Java Web应用程序的linux机器上,当我从tomcat运行应用程序时,文件/文件夹创建/修改权限被拒绝的问题 - On linux machine using tomcat for java web application, when i run application from tomcat, file/folder creation/modify permission denied issue 无法运行tomcat java:权限被拒绝 - can't run tomcat java: Permission denied 无法从IntelliJ插件运行程序“ adb” - Cannot run program “adb” from IntelliJ plugin
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM