centos6.6 安装adb环境

a.安装JDK环境java

centos linux JAVA(openjdk)软件包名
1.java-1.7.0-openjdk (OpenJDK Runtime Environment)
2.java-1.7.0-openjdk-devel (OpenJDK Development Environment)
 
yum install java-1.7.0-openjdk  java-1.7.0-openjdk-devel

坑1: 以前由于没有装”java-1.7.0-openjdk-devel”,因此系统里只有jre而没有jdk。后续在执行gradle命令时一直报错linux

Could not find tools.jar. Please check that /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.111-0.b15.el6_8.x86_64/jre contains a valid JDK installation.

后再从新安装了 java-1.7.0-openjdk  java-1.7.0-openjdk-devel以后,问题解决。android

 

b.下载androidSdkvim

cd /opt

mkdir androidSdk

wget https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip

unzip sdk-tools-linux-3859397.zip

b-1. 配置环境变量centos

#vim /etc/profileapi

export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL
export PATH=$PATH:/opt/androidSdk/tools/bin

#source /etc/profilebash

b-2. 查看已安装信息ssh

sdkmanager --list

    ......
  system-images;a...pis;armeabi-v7a | 6            | Google APIs ARM EABI v7a Syste...
  system-images;a...google_apis;x86 | 6            | Google APIs Intel x86 Atom Sys...
  system-images;a...gle_apis;x86_64 | 6            | Google APIs Intel x86 Atom_64 ...
  system-images;a...;android-tv;x86 | 3            | Android TV Intel x86 Atom Syst...
  system-images;a...ndroid-wear;x86 | 1            | Android Wear Intel x86 Atom Sy...
  system-images;a...google_apis;x86 | 4            | Google APIs Intel x86 Atom Sys...
  system-images;a...s_playstore;x86 | 4            | Google Play Intel x86 Atom Sys...
  tools                             | 26.0.2       | Android SDK Tools                

Available Updates:
  ID      | Installed | Available
  ------- | -------   | -------  
  tools   | 26.0.1    | 26.0.2

安装须要的包,如:jvm

sdkmanager "build-tools;26.0.2"

坑2:经过这种方法默认安装的platform-tools 下载的是26,在使用adb命令时一直报以下的错:gradle

 

升级lib库无效后,想到能够下载低版本的platform-tools,此问题解决。

platform tools下载地址

http://downloads.puresoftware.org/files/android/platform-tools/

c.配置环境变量  vim /etc/profile

...
export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL
export PATH=$PATH:/opt/androidSdk/tools/bin
export PATH=$PATH:/opt/androidSdk/platform-tools
...

而后执行更新生效
#source /etc/profile

 

d.执行adb命令

-bash: /opt/androidSdk/platform-tools/adb: /lib/ld-linux.so.2: bad ELF interpreter: 没有那个文件或目录

原来是由于系统的问题,由于个人系统是64位的,那adb这个程序是32位的

解决方案:
yum install glibc.i686
yum install libstdc*
yum install libstdc++.so.6

坑3: install的过程当中一直报错:

错误: Multilib version problems found. This often means that the root
      cause is something else and multilib version checking is just
      pointing out that there is a problem. Eg.:
      
        1. You have an upgrade for nss-softokn-freebl which is missing some
           dependency that another package requires. Yum is trying to
           solve this by installing an older version of nss-softokn-freebl of the
           different architecture. If you exclude the bad architecture
           yum will tell you what the root cause is (which package
           requires what). You can try redoing the upgrade with
           --exclude nss-softokn-freebl.otherarch ... this should give you an error
           message showing the root cause of the problem.
      
        2. You have multiple architectures of nss-softokn-freebl installed, but
           yum can only see an upgrade for one of those arcitectures.
           If you don't want/need both architectures anymore then you
           can remove the one with the missing update and everything
           will work.
      
        3. You have duplicate versions of nss-softokn-freebl installed already.
           You can use "yum check" to get yum show these errors.
      
      ...you can also use --setopt=protected_multilib=false to remove
      this checking, however this is almost never the correct thing to
      do as something else is very likely to go wrong (often causing
      much more problems).
      
      Protected multilib versions: nss-softokn-freebl-3.14.3-900.23.3.el6.x86_64 != nss-softokn-freebl-3.14.3-22.el6_6.i686

试过想删除这个冲突库,而后再从新install   “nss-softokn-freebl-3.14.3-900.23.3.el6.x86_64”

可是删除掉以后引起了不少系统问题,如yum,ssh,vim等命令均不支持。 强烈建议你们不要乱删库啊,血和泪的教训啊 ~~~

 

系统恢复后,发现其实错误信息里已经给出了很直接的忽略检查的参数,直接用就行了。。

yum install glibc.i686 --setopt=protected_multilib=false

安装成功~~ 问题解决。

再次运行adb命令 ~~ 成功~ 

相关文章
相关标签/搜索