centos7中安装Android SDK的方法步骤

本文介绍了centos7中安装Android SDK的方法步骤,分享给大家

0x01 下载sdktools

cd /opt

mkdir androidSdk

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

unzip sdk-tools-linux-3859397.zip

0x02 配置命令

打开 /opt/profile 添加sdk命令如下:

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

然后执行 source profile 使之生效

0x03 查看已安装信息

sdkmanager --list

Installed packages:
 Path        | Version | Description          | Location
 -------      | ------- | -------            | -------
 tools       | 26.0.1 | Android SDK Tools 26.0.1    | tools/

Available Packages:
 Path               | Version   | Description
 -------              | -------   | -------
 add-ons;addon-g..._apis-google-15 | 3      | Google APIs
 add-ons;addon-g..._apis-google-16 | 4      | Google APIs
 add-ons;addon-g..._apis-google-17 | 4      | Google APIs
 add-ons;addon-g..._apis-google-18 | 4      | Google APIs
 add-ons;addon-g..._apis-google-19 | 20      | Google APIs
 add-ons;addon-g..._apis-google-21 | 1      | Google APIs
 add-ons;addon-g..._apis-google-22 | 1      | Google APIs
 add-ons;addon-g..._apis-google-23 | 1      | Google APIs
 add-ons;addon-g..._apis-google-24 | 1      | Google APIs
 add-ons;addon-g...e_gdk-google-19 | 11      | Glass Development Kit Preview
 build-tools;19.1.0        | 19.1.0    | Android SDK Build-Tools 19.1
 build-tools;20.0.0        | 20.0.0    | Android SDK Build-Tools 20
 build-tools;21.1.2        | 21.1.2    | Android SDK Build-Tools 21.1.2
 build-tools;22.0.1        | 22.0.1    | Android SDK Build-Tools 22.0.1
 build-tools;23.0.1        | 23.0.1    | Android SDK Build-Tools 23.0.1
 build-tools;23.0.2        | 23.0.2    | Android SDK Build-Tools 23.0.2
 build-tools;23.0.3        | 23.0.3    | Android SDK Build-Tools 23.0.3
 build-tools;24.0.0        | 24.0.0    | Android SDK Build-Tools 24
 build-tools;24.0.1        | 24.0.1    | Android SDK Build-Tools 24.0.1
 build-tools;24.0.2        | 24.0.2    | Android SDK Build-Tools 24.0.2
 build-tools;24.0.3        | 24.0.3    | Android SDK Build-Tools 24.0.3
 build-tools;25.0.0        | 25.0.0    | Android SDK Build-Tools 25
 build-tools;25.0.1        | 25.0.1    | Android SDK Build-Tools 25.0.1
 build-tools;25.0.2        | 25.0.2    | Android SDK Build-Tools 25.0.2
 build-tools;25.0.3        | 25.0.3    | Android SDK Build-Tools 25.0.3
 build-tools;26.0.0        | 26.0.0    | Android SDK Build-Tools 26
 cmake;3.6.4111459         | 3.6.4111459 | CMake 3.6.4111459
 docs               | 1      | Documentation for Android SDK
 emulator             | 26.1.2    | Android Emulator
 extras;android;gapid;1      | 1.0.3    | GPU Debugging tools
 extras;android;gapid;3      | 3.1.0    | GPU Debugging tools
 extras;android;m2repository    | 47.0.0    | Android Support Repository
 extras;google;auto        | 1.1     | Android Auto Desktop Head Unit...
 extras;google;g...e_play_services | 42      | Google Play services
 extras;google;instantapps     | 1.0.0    | Instant Apps Development SDK
 extras;google;m2repository    | 55      | Google Repository
 extras;google;m...t_apk_expansion | 1      | Google Play APK Expansion library
 extras;google;market_licensing  | 1      | Google Play Licensing Library
 extras;google;play_billing    | 5      | Google Play Billing Library
 extras;google;simulators     | 1      | Android Auto API Simulators
 extras;google;webdriver      | 2      | Google Web Driver
 extras;m2reposi...ut-solver;1.0.0 | 1      | Solver for ConstraintLayout 1.0.0
 extras;m2reposi...er;1.0.0-alpha2 | 1      | com.android.support.constraint...
 extras;m2reposi...er;1.0.0-alpha3 | 1      | com.android.support.constraint...
 extras;m2reposi...er;1.0.0-alpha4 | 1      | com.android.support.constraint...
 extras;m2reposi...er;1.0.0-alpha5 | 1      | Solver for ConstraintLayout 1....
 extras;m2reposi...er;1.0.0-alpha6 | 1      | Solver for ConstraintLayout 1....
 extras;m2reposi...er;1.0.0-alpha7 | 1      | Solver for ConstraintLayout 1....
 extras;m2reposi...er;1.0.0-alpha8 | 1      | Solver for ConstraintLayout 1....
 extras;m2reposi...er;1.0.0-alpha9 | 1      | Solver for ConstraintLayout 1....
 extras;m2reposi...ver;1.0.0-beta1 | 1      | Solver for ConstraintLayout 1....
 extras;m2reposi...ver;1.0.0-beta2 | 1      | Solver for ConstraintLayout 1....
 extras;m2reposi...ver;1.0.0-beta3 | 1      | Solver for ConstraintLayout 1....
 extras;m2reposi...ver;1.0.0-beta4 | 1      | Solver for ConstraintLayout 1....
 extras;m2reposi...ver;1.0.0-beta5 | 1      | Solver for ConstraintLayout 1....
 extras;m2reposi...ut-solver;1.0.1 | 1      | Solver for ConstraintLayout 1.0.1
 extras;m2reposi...ut-solver;1.0.2 | 1      | Solver for ConstraintLayout 1.0.2
 extras;m2reposi...nt-layout;1.0.0 | 1      | ConstraintLayout for Android 1...
 extras;m2reposi...ut;1.0.0-alpha2 | 1      | com.android.support.constraint...
 extras;m2reposi...ut;1.0.0-alpha3 | 1      | com.android.support.constraint...
 extras;m2reposi...ut;1.0.0-alpha4 | 1      | com.android.support.constraint...
 extras;m2reposi...ut;1.0.0-alpha5 | 1      | ConstraintLayout for Android 1...
 extras;m2reposi...ut;1.0.0-alpha6 | 1      | ConstraintLayout for Android 1...
 extras;m2reposi...ut;1.0.0-alpha7 | 1      | ConstraintLayout for Android 1...
 extras;m2reposi...ut;1.0.0-alpha8 | 1      | ConstraintLayout for Android 1...
 extras;m2reposi...ut;1.0.0-alpha9 | 1      | ConstraintLayout for Android 1...
 extras;m2reposi...out;1.0.0-beta1 | 1      | ConstraintLayout for Android 1...
 extras;m2reposi...out;1.0.0-beta2 | 1      | ConstraintLayout for Android 1...
 extras;m2reposi...out;1.0.0-beta3 | 1      | ConstraintLayout for Android 1...
 extras;m2reposi...out;1.0.0-beta4 | 1      | ConstraintLayout for Android 1...
 extras;m2reposi...out;1.0.0-beta5 | 1      | ConstraintLayout for Android 1...
 extras;m2reposi...nt-layout;1.0.1 | 1      | ConstraintLayout for Android 1...
 extras;m2reposi...nt-layout;1.0.2 | 1      | ConstraintLayout for Android 1...
 lldb;2.0             | 2.0.2558144 | LLDB 2.0
 lldb;2.1             | 2.1.2852477 | LLDB 2.1
 lldb;2.2             | 2.2.3271982 | LLDB 2.2
 lldb;2.3             | 2.3.3614996 | LLDB 2.3
 ndk-bundle            | 15.1.4119039 | NDK
 patcher;v4            | 1      | SDK Patch Applier v4
 platform-tools          | 26.0.0    | Android SDK Platform-Tools
 platforms;android-10       | 2      | Android SDK Platform 10
 platforms;android-11       | 2      | Android SDK Platform 11
 platforms;android-12       | 3      | Android SDK Platform 12
 platforms;android-13       | 1      | Android SDK Platform 13
 platforms;android-14       | 4      | Android SDK Platform 14
 platforms;android-15       | 5      | Android SDK Platform 15
 platforms;android-16       | 5      | Android SDK Platform 16
 platforms;android-17       | 3      | Android SDK Platform 17
 platforms;android-18       | 3      | Android SDK Platform 18
 platforms;android-19       | 4      | Android SDK Platform 19
 platforms;android-20       | 2      | Android SDK Platform 20
 platforms;android-21       | 2      | Android SDK Platform 21
 platforms;android-22       | 2      | Android SDK Platform 22
 platforms;android-23       | 3      | Android SDK Platform 23
 platforms;android-24       | 2      | Android SDK Platform 24
 platforms;android-25       | 3      | Android SDK Platform 25
 platforms;android-26       | 1      | Android SDK Platform 26
 platforms;android-7        | 3      | Android SDK Platform 7
 platforms;android-8        | 3      | Android SDK Platform 8
 platforms;android-9        | 2      | Android SDK Platform 9
 sources;android-15        | 2      | Sources for Android 15
 sources;android-16        | 2      | Sources for Android 16
 sources;android-17        | 1      | Sources for Android 17
 sources;android-18        | 1      | Sources for Android 18
 sources;android-19        | 2      | Sources for Android 19
 sources;android-20        | 1      | Sources for Android 20
 sources;android-21        | 1      | Sources for Android 21
 sources;android-22        | 1      | Sources for Android 22
 sources;android-23        | 1      | Sources for Android 23
 sources;android-24        | 1      | Sources for Android 24
 sources;android-25        | 1      | Sources for Android 25
 system-images;a...ult;armeabi-v7a | 4      | ARM EABI v7a System Image
 system-images;a...-10;default;x86 | 4      | Intel x86 Atom System Image
 system-images;a...pis;armeabi-v7a | 5      | Google APIs ARM EABI v7a Syste...
 system-images;a...google_apis;x86 | 5      | Google APIs Intel x86 Atom Sys...
 system-images;a...ult;armeabi-v7a | 2      | ARM EABI v7a System Image
 system-images;a...ult;armeabi-v7a | 4      | ARM EABI v7a System Image
 system-images;a...15;default;mips | 1      | MIPS System Image
 system-images;a...-15;default;x86 | 4      | Intel x86 Atom System Image
 system-images;a...pis;armeabi-v7a | 5      | Google APIs ARM EABI v7a Syste...
 system-images;a...google_apis;x86 | 5      | Google APIs Intel x86 Atom Sys...
 system-images;a...ult;armeabi-v7a | 4      | ARM EABI v7a System Image
 system-images;a...16;default;mips | 1      | MIPS System Image
 system-images;a...-16;default;x86 | 5      | Intel x86 Atom System Image
 system-images;a...pis;armeabi-v7a | 5      | Google APIs ARM EABI v7a Syste...
 system-images;a...google_apis;x86 | 5      | Google APIs Intel x86 Atom Sys...
 system-images;a...ult;armeabi-v7a | 5      | ARM EABI v7a System Image
 system-images;a...17;default;mips | 1      | MIPS System Image
 system-images;a...-17;default;x86 | 3      | Intel x86 Atom System Image
 system-images;a...pis;armeabi-v7a | 5      | Google APIs ARM EABI v7a Syste...
 system-images;a...google_apis;x86 | 5      | Google APIs Intel x86 Atom Sys...
 system-images;a...ult;armeabi-v7a | 4      | ARM EABI v7a System Image
 system-images;a...-18;default;x86 | 3      | Intel x86 Atom System Image
 system-images;a...pis;armeabi-v7a | 5      | Google APIs ARM EABI v7a Syste...
 system-images;a...google_apis;x86 | 5      | Google APIs Intel x86 Atom Sys...
 system-images;a...ult;armeabi-v7a | 5      | ARM EABI v7a System Image
 system-images;a...-19;default;x86 | 5      | Intel x86 Atom System Image
 system-images;a...pis;armeabi-v7a | 28      | Google APIs ARM EABI v7a Syste...
 system-images;a...google_apis;x86 | 28      | Google APIs Intel x86 Atom Sys...
 system-images;a...-tv;armeabi-v7a | 3      | Android TV ARM EABI v7a System...
 system-images;a...;android-tv;x86 | 3      | Android TV Intel x86 Atom Syst...
 system-images;a...ult;armeabi-v7a | 4      | ARM EABI v7a System Image
 system-images;a...-21;default;x86 | 4      | Intel x86 Atom System Image
 system-images;a...;default;x86_64 | 4      | Intel x86 Atom_64 System Image
 system-images;a...pis;armeabi-v7a | 20      | Google APIs ARM EABI v7a Syste...
 system-images;a...google_apis;x86 | 20      | Google APIs Intel x86 Atom Sys...
 system-images;a...gle_apis;x86_64 | 20      | Google APIs Intel x86 Atom_64 ...
 system-images;a...-tv;armeabi-v7a | 1      | Android TV ARM EABI v7a System...
 system-images;a...;android-tv;x86 | 3      | Android TV Intel x86 Atom Syst...
 system-images;a...ult;armeabi-v7a | 2      | ARM EABI v7a System Image
 system-images;a...-22;default;x86 | 5      | Intel x86 Atom System Image
 system-images;a...;default;x86_64 | 5      | Intel x86 Atom_64 System Image
 system-images;a...pis;armeabi-v7a | 14      | Google APIs ARM EABI v7a Syste...
 system-images;a...google_apis;x86 | 14      | Google APIs Intel x86 Atom Sys...
 system-images;a...gle_apis;x86_64 | 14      | Google APIs Intel x86 Atom_64 ...
 system-images;a...-tv;armeabi-v7a | 10      | Android TV ARM EABI v7a System...
 system-images;a...;android-tv;x86 | 10      | Android TV Intel x86 Atom Syst...
 system-images;a...ear;armeabi-v7a | 6      | Android Wear ARM EABI v7a Syst...
 system-images;a...ndroid-wear;x86 | 6      | Android Wear Intel x86 Atom Sy...
 system-images;a...-23;default;x86 | 9      | Intel x86 Atom System Image
 system-images;a...;default;x86_64 | 9      | Intel x86 Atom_64 System Image
 system-images;a...pis;armeabi-v7a | 21      | Google APIs ARM EABI v7a Syste...
 system-images;a...google_apis;x86 | 21      | Google APIs Intel x86 Atom Sys...
 system-images;a...gle_apis;x86_64 | 21      | Google APIs Intel x86 Atom_64 ...
 system-images;a...;android-tv;x86 | 11      | Android TV Intel x86 Atom Syst...
 system-images;a...fault;arm64-v8a | 7      | ARM 64 v8a System Image
 system-images;a...ult;armeabi-v7a | 7      | ARM EABI v7a System Image
 system-images;a...-24;default;x86 | 7      | Intel x86 Atom System Image
 system-images;a...;default;x86_64 | 7      | Intel x86 Atom_64 System Image
 system-images;a..._apis;arm64-v8a | 14      | Google APIs ARM 64 v8a System ...
 system-images;a...pis;armeabi-v7a | 14      | Google APIs ARM EABI v7a Syste...
 system-images;a...google_apis;x86 | 14      | Google APIs Intel x86 Atom Sys...
 system-images;a...gle_apis;x86_64 | 14      | Google APIs Intel x86 Atom_64 ...
 system-images;a...s_playstore;x86 | 13      | Google Play Intel x86 Atom Sys...
 system-images;a...;android-tv;x86 | 5      | Android TV Intel x86 Atom Syst...
 system-images;a...ear;armeabi-v7a | 3      | Android Wear ARM EABI v7a Syst...
 system-images;a...ndroid-wear;x86 | 3      | Android Wear Intel x86 Atom Sy...
 system-images;a..._apis;arm64-v8a | 6      | Google APIs ARM 64 v8a System ...
 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

0x04 安装需要的package

sdkmanager "build-tools;26.0.0"

根据需要安装,最后我安装的结果如下:

Installed packages:
 Path            | Version | Description          | Location
 -------           | ------- | -------            | -------
 build-tools;25.0.3     | 25.0.3 | Android SDK Build-Tools 25.0.3 | build-tools/25.0.3/
 build-tools;26.0.0     | 26.0.0 | Android SDK Build-Tools 26   | build-tools/26.0.0/
 emulator          | 26.1.2 | Android Emulator        | emulator/
 extras;android;m2repository | 47.0.0 | Android Support Repository   | extras/android/m2repository/
 patcher;v4         | 1    | SDK Patch Applier v4      | patcher/v4/
 platform-tools       | 26.0.0 | Android SDK Platform-Tools   | platform-tools/
 platforms;android-21    | 2    | Android SDK Platform 21    | platforms/android-21/
 platforms;android-22    | 2    | Android SDK Platform 22    | platforms/android-22/
 platforms;android-23    | 3    | Android SDK Platform 23    | platforms/android-23/
 platforms;android-24    | 2    | Android SDK Platform 24    | platforms/android-24/
 platforms;android-25    | 3    | Android SDK Platform 25    | platforms/android-25/
 platforms;android-26    | 1    | Android SDK Platform 26    | platforms/android-26/
 tools            | 26.0.2 | Android SDK Tools       | tools/

0x05 配置platform tools

打开 /etc/profile 添加如下命令:

cd /etc

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

//然后执行更新生效
source profile

查看配置结果:

# adb version

Android Debug Bridge version 1.0.39
Revision 3db08f2c6889-android
Installed as /opt/androidSdk/platform-tools/adb

从结果可以看出已经可以执行 adb 命令了.

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持我们。

(0)

相关推荐

  • CentOS Linux系统搭建Android开发环境详细介绍

    CentOS Linux系统搭建Android开发环境详细介绍 很多人都是在Windows下进行Android开发,但是对于Linux,Android开发环境方面的资料比较少,今天在网上找到了一位网友分享的在CentOS Linux系统中搭建Android开发环境的过程.下面就是其介绍的配置的详细步骤原文: 由于我最近每天使用的是CentOS 5.5,所以选择CentOS5.5作为我的开发环境. 主要包括以下步骤: 1.JDK安装 2.Eclipse安装 3.ADT安装 4.Android SD

  • centos7中安装Android SDK的方法步骤

    本文介绍了centos7中安装Android SDK的方法步骤,分享给大家 0x01 下载sdktools cd /opt mkdir androidSdk wget https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip unzip sdk-tools-linux-3859397.zip 0x02 配置命令 打开 /opt/profile 添加sdk命令如下: ... export PATH USER LOGNA

  • Linux系统下安装android sdk的方法步骤

    本文阐述的是如何在Linux系统中安装Android SDK 环境,下面话不多说,来看看详细的介绍吧. 直接下载解压: wget http://dl.google.com/android/android-sdk_r22.0.5-linux.tgz 修改对应的版本号即可. 关于后续的sdk更新,可以使用命令行版本的sdkmanager 直接更新到最新的sdk: tools/android update sdk --no-ui 显示所有的sdk版本 android list sdk --all 会得

  • 在python3.64中安装pyinstaller库的方法步骤

    Python中为了方便程序直接生成exe文件,它存在一个pyinstaller库,使用这个库可以直接将.py程序生成exe文件.这个命令不是在windows的命令行中执行的. 对于python3.5以下的版本,可以在cmd命令中直接使用. 首先下载pyinstaller库使用pip install pyinstaller下载这个库,下载成功后出现successfully代表下载成功.然后执行命令是 pyinstaller -F -w <文件名.py>,执行命令时需要切换到程序所在的目录,-F代

  • 如何在vscode中安装python库的方法步骤

    vscode安装python库 1.已经在vscode中装了python并配置好python运行环境. 检查是否正确配置好运行环境,按Windows+R组合键在运行窗口输入cmd,打开命令提示符窗口输入python确定即可 2.找到vscode中python的路径 随便运行一个代码,例如print("hehe")下面的终端显示如下 图中红色地方圈起的便是python的路径,到python3.8为止. 如果你所显示的内容与我不同,可在setting.json中查找并将路径复制下来(在vs

  • 如何在CentOS中安装PHP7.4的方法步骤

    本指南提供了在 CentOS 8 / RHEL 8 Linux 系统上安装 PHP 7.4 的步骤.有兴趣的开发者已经可以在生产环境中使用使用 PHP 7.4,正式版本的官方发布时间为2019 年 11 月 28 日. 请按照以下步骤在 CentOS 8 / RHEL 8 上安装 PHP 7.4. 步骤一:添加 EPEL 和 REMI 库 安装需要 EPEL 和 REMI 库.通过以下命令将其添加到系统中 sudo yum -y install https://dl.fedoraproject.

  • 阿里云centos7中安装MySQL8.0.13的方法步骤

    1.下载MySQL安装包 (这里是有技巧的,说不定我这时写这个的时候版本还是你看到时的旧版本了,如果已经不是8.0了,可以根据这样来 下新版本) 先进入官网 再将这两者一结合,就是最新版本的了 所以 [root@h1 ~]# rpm -ivh http://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm 2.安装mysql [root@localhost ~]# yum install -y mysql-server 或

  • vmware虚拟机安装安卓Android x86的方法步骤

    有时候只是想测试一个app,又不想在手机上做个测试,这个时候我们就可以用虚拟机来完成这件事情.首先到官网上去下载一个安卓系统(https://www.android-x86.org/),我这里用:android-x86-9.0-rc1.iso做演示. 或者选择本地安卓系统下载地址:https://www.jb51.net/softs/203311.html 在提供一个VMware15的下载地址:https://www.jb51.net/softs/638385.html VMware15 for

  • Android Studio设置或修改Android SDK路径方法

    不少朋友自己下载了一个Android SDK,怎样在Android studio中默认的Android SDK路径呢? 打开Android studio,点击"File"菜单下的"Other Settings",接着点击"Default Project Structure"选项. 2.这时就会看到SDK Location,点击图示第二个红色区域的图标,就可以修改默认的AndroidSDK路径. 1.修改SDK路径方法/步骤2 点击"Fi

  • Centos7下安装MySQL8.0.23的步骤(小白入门级别)

    首先简单介绍一下什么叫MySQL: 数据库简而言之就是存储数据的仓库,为了方便数据的存储和管理,它将数据按照特定的规律存储在磁盘上.是为了实现一定的目的,按照某种规则组织起来的数据的集合: MySQL是一种开放源代码的关系型数据库管理系统(RDBMS),使用最常用的数据库管理语言--结构化bai查询语言(SQL)进行数据库管理.通过数据库管理系统,可以有效的组织和管理存储在数据库中的数据. 那么我们常见的数据库模型: 1,关系型数据库 MySql Oracle SQL Server 2,非关系型

  • deepin 2014系统下安装mysql数据库的方法步骤

    Deepin 2014下载及安装 Deepin 2014的下载及安装大家可以参考下面这两篇文章,一篇为正式版的下载与安装,另外一篇文章给大家分享了deepin 2014用U盘安装的方法步骤,需要的朋友们可以参考学习: Deepin 2014.2正式版下载 和安装教程 deepin 2014 U盘安装方法及注意事项详解 好了,下面进入本文的重要内容:deepin 2014系统下安装mysql数据库的方法步骤,一起来看看吧. 一:安装mysql 打开deepin terminal: 在此过程中会提示

随机推荐