Ubuntu配置Eclipse + Android环境问题

forDream_ 2012-05-22 12:59:51
eclipse完全正常、然后运行后、无法创建AVD、打开DDMS视图提示adb没有权限、然后我在终端下输入android -h
提示:bash: /media/m_backup/Setup_Files/Programing/android-sdk-linux/tools/android: 权限不够
然后输入sudo android -h
提示:sudo: android:找不到命令

打开DDMS视图提示:
Failed to get the adb version: Cannot run program "/media/m_backup/Setup_Files/Programing/android-sdk-linux/platform-tools/adb": java.io.IOException: error=13, 权限不够 from '/media/m_backup/Setup_Files/Programing/android-sdk-linux/platform-tools/adb' - exists=true

创建AVD提示:
[2012-05-22 12:57:49 - SDK Manager] Failed to create the SD card.
[2012-05-22 12:57:49 - SDK Manager] Failed to create sdcard in the AVD folder.

初次用linux内核的系统、也不会分析原因、上百度搜索出来的结果无非是设置环境变量、检查abd是否存在、是否有执行权限、都没有解决.
在尝试添加执行权限的时候(chmod a+x *)sudo执行也试过、没有任何错误提示、不过ls -l查看结果如下 没有添加上执行权限


fordream@pc-fordream:/media/m_backup/Setup_Files/Programing/android-sdk-linux/tools$ ls -l
总用量 4133
-rw------- 1 fordream fordream 323 5月 21 07:59 adb_has_moved.txt
-rw------- 1 fordream fordream 3491 5月 21 07:59 android
drwx------ 1 fordream fordream 0 5月 21 07:59 ant
-rw------- 1 fordream fordream 1977 5月 21 07:59 apkbuilder
drwx------ 1 fordream fordream 0 5月 21 07:59 apps
-rw------- 1 fordream fordream 3116 5月 21 07:59 ddms
-rw------- 1 fordream fordream 46724 5月 21 07:59 dmtracedump
-rw------- 1 fordream fordream 1940 5月 21 07:59 draw9patch
-rw------- 1 fordream fordream 24828 5月 21 07:59 emulator
-rw------- 1 fordream fordream 2814128 5月 21 07:59 emulator-arm
-rw------- 1 fordream fordream 2765428 5月 21 07:59 emulator-x86
-rw------- 1 fordream fordream 136860 5月 21 07:59 etc1tool
-rw------- 1 fordream fordream 3282 5月 21 07:59 hierarchyviewer
-rw------- 1 fordream fordream 9680 5月 21 07:59 hprof-conv
drwx------ 1 fordream fordream 8192 5月 21 07:59 lib
-rw------- 1 fordream fordream 2015 5月 21 07:59 lint
-rw------- 1 fordream fordream 9676 5月 21 07:59 mksdcard
-rw------- 1 fordream fordream 3169 5月 21 07:59 monkeyrunner
-rw------- 1 fordream fordream 379587 5月 21 07:59 NOTICE.txt
drwx------ 1 fordream fordream 4096 5月 21 07:59 proguard
-rw------- 1 fordream fordream 231 5月 21 07:59 source.properties
-rw------- 1 fordream fordream 613856 5月 21 07:59 sqlite3
drwx------ 1 fordream fordream 0 5月 21 07:59 support
-rw------- 1 fordream fordream 3044 5月 21 07:59 traceview
-rw------- 1 fordream fordream 46784 5月 21 07:59 zipalign

求解这是什么原因?该如何解决呢?
...全文
799 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
白板码匠 2013-07-18
  • 打赏
  • 举报
回复
这里有个回复说是没有执行权限 The reason you could not run it is because the SDK was on an external drive mounted with the noexec flag active. If you run the mount command you should see the word noexec on the line of the external drive. This is a safety feature to prevent executing malicious software by accident. As a result the android binary could not have the executable bit set, hence you could not run it. Copying it to a different disk (as you did) where you can set the executable bit with chmod +x /path/to/android is the solution.
白板码匠 2013-07-18
  • 打赏
  • 举报
回复
这个估计不是权限的问题,因为media目录下的是挂载目录,挂载的其它磁盘的目录,分析原因可能有二: 1、linux访问挂载目录问题; 2、挂载目录的格式问题(FAT32、NTFS). 目前还没找到原因
i3shan 2012-11-19
  • 打赏
  • 举报
回复
Failed to get the adb version: Cannot run program "/home/yema/android-sdk/tools/adb": error=13,权限不够 解决办法:赋权限 yema@ubuntu:~$ cd ~/android-sdk/ yema@ubuntu:~/android-sdk$ sudo chmod -R a+wrx * 我的是64bit的,运行就OK 了
  • 打赏
  • 举报
回复
chmod -r XXX /media/m_backup/Setup_Files/Programing/android-sdk-linux/tools/android

58,452

社区成员

发帖
与我相关
我的任务
社区描述
Java Eclipse
社区管理员
  • Eclipse
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧