简体   繁体   English

Android adb未找到

[英]Android adb not found

When I run my android app from eclipse, I get this error. 当我从eclipse运行我的Android应用程序时,我收到此错误。

Unexpected exception 'Cannot run program "/home/antz/Development/adt-bundle-linux/sdk/platform-tools/adb": error=2 No such file or directory' while attempting to get adb version from /home/antz/Development/adt-bundle-linux/sdk/platform-tools/adb

COPY PASTE FROM Eclipse Error 从Eclipse错误复制粘贴

[2012-11-26 13:43:08 - adb] Unexpected exception 'Cannot run program "/home/antz/Development/adt-bundle-linux/sdk/platform-tools/adb": error=2, No such file or directory' while attempting to get adb version from '/home/antz/Development/adt-bundle-linux/sdk/platform-tools/adb'

However my adb is exactly in the location where it says it's not. 然而,我的adb恰好位于它所说的不是的位置。

What is wrong and how do I fix this? 有什么问题,我该如何解决这个问题?

I cd into the directory where adb is ( /home/antz/Development/adt-bundle-linux/sdk/platform-tools/ ) and I typed in adb and it says 我进入了adb所在的目录( /home/antz/Development/adt-bundle-linux/sdk/platform-tools/ ),我输入了adb,它说

antz@antz-90X3A:~/Development/adt-bundle-linux/sdk/platform-tools$ ls  
aapt  aidl  dexdump  fastboot  llvm-rs-cc  renderscript  
adb   api   dx       lib       NOTICE.txt  source.properties  
antz@antz-90X3A:~/Development/adt-bundle-linux/sdk/platform-tools$ adb  
bash: /home/antz/Development/adt-bundle-linux/sdk/platform-tools/adb: No such file or directory

adb is green which means its an executable, correct? adb是绿色的,这意味着它是可执行的,对吗?

for example, dx is also green and when I typed in dx into the command prompt, it works... whats wrong with adb? 例如,dx也是绿色的,当我在命令提示符下输入dx时,它的工作原理... adb是什么问题?

On Linux, Android SDK platform-tools package containing adb used to be 32bit . 在Linux上,包含adb Android SDK platform-tools包曾经是32bit It worked fine on 32bit systems. 它在32bit系统上运行良好。 But on 64bit systems you need to manually install the IA32 library. 但在64bit系统上,您需要手动安装IA32库。

For Debian based distributions try this: 对于基于Debian的发行版,试试这个:

sudo apt-get install libc6-i386 lib32stdc++6 lib32gcc1 lib32ncurses5

But since v24.0 platform-tools contains only 64bit binaries - so 32bit libraries no longer required. 但由于v24.0 platform-tools仅包含64bit二进制文件 - 因此不再需要32bit库。

You can no longer install ia32-libs, so you must the individual 32 bit libraries needed by adb 您无法再安装ia32-libs,因此您必须使用adb所需的各个32位库

sudo apt-get install libc6-i386 lib32stdc++6 lib32gcc1 lib32ncurses5

And for Ubuntu 13.10: 而对于Ubuntu 13.10:

sudo apt-get install libc6-i386 lib32stdc++6 lib32gcc1 lib32ncurses5 lib32z1

You have to install the 32 bit glibc: 你必须安装32位glibc:

in Fedore 64 bit machine 在Fedore 64位机器上

# yum install glibc.i686

This removes the misleading 'no such file or directory' message when trying to execute a 32 bit binary. 这在尝试执行32位二进制文​​件时消除了误导性的“无此类文件或目录”消息。 With that the 64 bit Fedora system is capable of executing 64 bit binaries. 有了这个64位Fedora系统能够执行64位二进制文​​件。

This also removes the misleading 'not a dynamic executable' message of ldd when calling ldd on a 32 bit dynamic executable. 当在32位动态可执行文件上调用ldd时,这也消除了ldd的误导性“非动态可执行”消息。

Now you have to install missing 32 bit libraries the binaries under adt-bundle-linux/sdk/platform-tools are linked against: 现在你必须安装缺少的32位库,adt-bundle-linux / sdk / platform-tools下的二进制文件链接到:

# yum install zlib.i686 libstdc++.i686 ncurses-libs.i686 libgcc.i686

Thats it. 而已。

I'm using Ubuntu 14.04 LTS 64-bit and the following code works for me ; 我正在使用Ubuntu 14.04 LTS 64位 ,以下代码适用于我 ;

sudo apt-get install lib32z1 lib32z1-dev
sudo apt-get install lib32stdc++6


Summary: 摘要:

After I tried apt-get install ia32-libs , but apt package tool suggest that; 之后我尝试了apt-get install ia32-libs ,但apt包工具提示;

 Package ia32-libs is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source. However the following packages replace it: lib32z1 lib32ncurses5 lib32bz2-1.0 

Then the above code works for me. 那么上面的代码对我有用。

This works great in Ubuntu 13.04 64bit version 这在Ubuntu 13.04 64位版本中效果很好

You can no longer install ia32-libs, so you must the individual 32 bit libraries needed by adb 您无法再安装ia32-libs,因此您必须使用adb所需的各个32位库

sudo apt-get install libc6-i386 lib32stdc++6 lib32gcc1 lib32ncurses5

On Arch linux: 在Arch linux上:

Enable the "multiarch" repositories in /etc/pacman.conf 在/etc/pacman.conf中启用“multiarch”存储库

then run: 然后运行:

root@box#pacman -Syu

root@box#pacman -S lib32-glibc lib32-zlib lib32-libstdc++5 lib32-ncurses lib32-gcc-libs

I am running Ubuntu 12.04 LTS and this command is the only thing that worked for me: 我正在运行Ubuntu 12.04 LTS,这个命令对我来说是唯一有用的:

sudo apt-get install lib32z1 lib32z1-dev

Once I ran that from a command line, I was able to get the R.java file to generate (the tell-tale sign that something in your Android SDK tools installation is not quite right) by doing a Project > Clean in Eclipse. 一旦我从命令行运行它,我就可以通过在Eclipse中执行Project> Clean来生成R.java文件(说明Android SDK工具安装中的某些内容不太正确)。

在Fedora 17或18上:

sudo yum install redhat-lsb.i686

For multiarch Debian 7.0, add: 对于multiarch Debian 7.0,添加:

dpkg --add-architecture i386
apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386

您需要安装ia32-libs(IA32库)包才能实现此功能。

我在Linux Mint 12中做到了:

   chmod +x PATH/adb

if you're having this problem in 64bits, try this (worked for me): 如果你在64位有这个问题,试试这个(为我工作):

$ apt-get install lib32gcc1 libc6-i386 lib32z1 lib32stdc++6
$ apt-get install lib32ncurses5 lib32gomp1 lib32z1-dev lib32bz2-dev
$ apt-get install g++-multilib

http://sixarm.com/about/ubuntu-apt-get-install-ia32-for-32-bit-on-64-bit.html http://sixarm.com/about/ubuntu-apt-get-install-ia32-for-32-bit-on-64-bit.html

From the Ubuntu Multiarch HOWTO : 来自Ubuntu Multiarch HOWTO

Some users using the Android SDK might encounter problems when trying to run build-tools or platform-tools on amd64 bit platform. 尝试在amd64位平台上运行构建工具或平台工具时,某些使用Android SDK的用户可能会遇到问题。 As replacement for ia32-libs, users should be fine just installing the following libraries: 作为ia32-libs的替代品,用户应该可以正常安装以下库:

dpkg --add-architecture i386
aptitude update
aptitude install libstdc++6:i386 libgcc1:i386 zlib1g:i386 libncurses5:i386

在linux apt-get install ia32-libs中安装这些库

Run these commands below. 在下面运行这些命令。 Its worked for me 它对我有用

sudo apt-get dist-upgrade
sudo apt-get install ia32-libs

in ubuntu 64 bits [12.04]-[14.10] and Elementary OS 64 bits 在ubuntu 64位[12.04] - [14.10]和基本OS 64位

sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libncurses5:i386 libstdc++6:i386 zlib1g:i386

Sometimes it's just a matter giving sdk files the necessary permissions. 有时它只是给sdk文件提供必要的权限。

sudo chmod -R +x /path/to/android-sdk-linux

Restart Android Studio and see if that fix it. 重启Android Studio,看看是否能解决问题。

Permission issues typically occur when you copy/move sdk files from a NTFS partition or copying from another computer. 从NTFS分区复制/移动sdk文件或从另一台计算机复制时,通常会发生权限问题。

sudo apt install adb sudo apt install adb

adb not installed in your pc adb未安装在您的电脑中

Try this. 试试这个。

http://abhinavasblog.blogspot.sg/2013/10/working-with-ubuntu-1304-and-1310-java.html http://abhinavasblog.blogspot.sg/2013/10/working-with-ubuntu-1304-and-1310-java.html

the blog explain resolution to Ubuntu 13.10 for installing Chrome, Java and Fixing Android SDK. 该博客向Ubuntu 13.10解释了解决安装Chrome,Java和修复Android SDK的问题。

The correct current combo for Arch Linux is as follows: : Arch Linux的正确当前组合如下:

[This part is unchanged] Uncomment the following section in /etc/pacman.conf : [此部分未更改]取消注释/etc/pacman.conf的以下部分:

...
[multilib]
Include = /etc/pacman.d/mirrorlist
...

Then: 然后:

sudo pacman -Syu && sudo pacman -S multilib/lib32-libstdc++5 multilib/lib32-zlib

The difference with the other answer is that package names include the multilib/ part now. 与其他答案的不同之处在于包名称现在包含multilib / part。

(from Arch Wiki: Multilib#Enabling , Android#Troubleshooting ) (来自Arch Wiki: Multilib #EnablingAndroid#Troubleshooting

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM