Centos 安装 Android sdk

戚浩淼
2023-12-01

1.下载Android sdk

       1.1 Android sdk 下载

我这边是本地windows下载好,scp推到服务器的:

scp android-sdk_r24.4.1-linux.tgz root@192.168.0.189:/root/software

scp命令: windows的cmd提示没有此命令,就使用git shell替换cmd(windows环境要用linux的一些命令方法很多)
scp 本地文件 远程用户名@远程ip:需要推到服务器的目录

        1.2 使用命令:wget http://dl.google.com/android/android-sdk_r24.4.1-linux.tgz

2.解压:

tar -zvxf android-sdk_r24.4.1-linux.tgz

3.配置环境变量:

vim /etc/profile
export ANDROID_HOME=/root/software/android-sdk-linux
export PATH=$ANDROID_HOME/tools:$PATH
export PATH=$ANDROID_HOME/platform-tools:$PATH

4.刷新环境变量:

source /etc/profile

此时,用adb命令还是提示adb命令不可识别,解压只是将sdk自带的工具装好了,还需要下载一些镜像,adb build tools 、platforms等工具

5.列出可以下载的资料:

[root@localhost software]# android list sdk --all    # 一下是所有sdk可下载的资源
Refresh Sources:
  Fetching https://dl.google.com/android/repository/addons_list-2.xml
  Validate XML
  Parse XML
  Fetched Add-ons List successfully
  Refresh Sources
  Fetching URL: https://dl.google.com/android/repository/repository-11.xml
  Validate XML: https://dl.google.com/android/repository/repository-11.xml
  Parse XML:    https://dl.google.com/android/repository/repository-11.xml
  Fetching URL: https://dl.google.com/android/repository/addon.xml
  Validate XML: https://dl.google.com/android/repository/addon.xml
  Parse XML:    https://dl.google.com/android/repository/addon.xml
  Fetching URL: https://dl.google.com/android/repository/glass/addon.xml
  Validate XML: https://dl.google.com/android/repository/glass/addon.xml
  Parse XML:    https://dl.google.com/android/repository/glass/addon.xml
  Fetching URL: https://dl.google.com/android/repository/extras/intel/addon.xml
  Validate XML: https://dl.google.com/android/repository/extras/intel/addon.xml
  Parse XML:    https://dl.google.com/android/repository/extras/intel/addon.xml
  Fetching URL: https://dl.google.com/android/repository/sys-img/android/sys-img.xml
  Validate XML: https://dl.google.com/android/repository/sys-img/android/sys-img.xml
  Parse XML:    https://dl.google.com/android/repository/sys-img/android/sys-img.xml
  Fetching URL: https://dl.google.com/android/repository/sys-img/android-wear/sys-img.xml
  Validate XML: https://dl.google.com/android/repository/sys-img/android-wear/sys-img.xml
  Parse XML:    https://dl.google.com/android/repository/sys-img/android-wear/sys-img.xml
  Fetching URL: https://dl.google.com/android/repository/sys-img/android-tv/sys-img.xml
  Validate XML: https://dl.google.com/android/repository/sys-img/android-tv/sys-img.xml
  Parse XML:    https://dl.google.com/android/repository/sys-img/android-tv/sys-img.xml
  Fetching URL: https://dl.google.com/android/repository/sys-img/google_apis/sys-img.xml
  Validate XML: https://dl.google.com/android/repository/sys-img/google_apis/sys-img.xml
  Parse XML:    https://dl.google.com/android/repository/sys-img/google_apis/sys-img.xml
  Fetching URL: https://dl.google.com/android/repository/sys-img/google_apis_playstore/sys-img.xml
  Validate XML: https://dl.google.com/android/repository/sys-img/google_apis_playstore/sys-img.xml
  Parse XML:    https://dl.google.com/android/repository/sys-img/google_apis_playstore/sys-img.xml
Packages available for installation or update: 235
   1- Android SDK Tools, revision 25.2.5 (Obsolete)
   2- Android SDK Platform-tools, revision 29.0.6
   3- Android SDK Build-tools, revision 30 rc2
   4- Android SDK Build-tools, revision 29.0.3
   5- Android SDK Build-tools, revision 29.0.2
   6- Android SDK Build-tools, revision 29.0.1
   7- Android SDK Build-tools, revision 29
   8- Android SDK Build-tools, revision 28.0.3
   9- Android SDK Build-tools, revision 28.0.2
  10- Android SDK Build-tools, revision 28.0.1
  11- Android SDK Build-tools, revision 28
  12- Android SDK Build-tools, revision 27.0.3
  13- Android SDK Build-tools, revision 27.0.2
  14- Android SDK Build-tools, revision 27.0.1
  15- Android SDK Build-tools, revision 27
  16- Android SDK Build-tools, revision 26.0.3
  17- Android SDK Build-tools, revision 26.0.2
  18- Android SDK Build-tools, revision 26.0.1
  19- Android SDK Build-tools, revision 26
  20- Android SDK Build-tools, revision 25.0.3
  21- Android SDK Build-tools, revision 25.0.2
  22- Android SDK Build-tools, revision 25.0.1
  23- Android SDK Build-tools, revision 25
  24- Android SDK Build-tools, revision 24.0.3
  25- Android SDK Build-tools, revision 24.0.2
  26- Android SDK Build-tools, revision 24.0.1
  27- Android SDK Build-tools, revision 24
  28- Android SDK Build-tools, revision 23.0.3
  29- Android SDK Build-tools, revision 23.0.2
  30- Android SDK Build-tools, revision 23.0.1
  31- Android SDK Build-tools, revision 23 (Obsolete)
  32- Android SDK Build-tools, revision 22.0.1
  33- Android SDK Build-tools, revision 22 (Obsolete)
  34- Android SDK Build-tools, revision 21.1.2
  35- Android SDK Build-tools, revision 21.1.1 (Obsolete)
  36- Android SDK Build-tools, revision 21.1 (Obsolete)
  37- Android SDK Build-tools, revision 21.0.2 (Obsolete)
  38- Android SDK Build-tools, revision 21.0.1 (Obsolete)
  39- Android SDK Build-tools, revision 21 (Obsolete)
  40- Android SDK Build-tools, revision 20
  41- Android SDK Build-tools, revision 19.1
  42- Android SDK Build-tools, revision 19.0.3 (Obsolete)
  43- Android SDK Build-tools, revision 19.0.2 (Obsolete)
  44- Android SDK Build-tools, revision 19.0.1 (Obsolete)
  45- Android SDK Build-tools, revision 19 (Obsolete)
  46- Android SDK Build-tools, revision 18.1.1 (Obsolete)
  47- Android SDK Build-tools, revision 18.1 (Obsolete)
  48- Android SDK Build-tools, revision 18.0.1 (Obsolete)
  49- Android SDK Build-tools, revision 17 (Obsolete)
  50- Documentation for Android SDK, API 24, revision 1
  51- SDK Platform Android 10, API 29, revision 4
  52- SDK Platform Android R Preview, revision 2
  53- SDK Platform Android 9, API 28, revision 6
  54- SDK Platform Android 8.1.0, API 27, revision 3
  55- SDK Platform Android 8.0.0, API 26, revision 2
  56- SDK Platform Android 7.1.1, API 25, revision 3
  57- SDK Platform Android 7.0, API 24, revision 2
  58- SDK Platform Android 6.0, API 23, revision 3
  59- SDK Platform Android 5.1.1, API 22, revision 2
  60- SDK Platform Android 5.0.1, API 21, revision 2
  61- SDK Platform Android 4.4W.2, API 20, revision 2
  62- SDK Platform Android 4.4.2, API 19, revision 4
  63- SDK Platform Android 4.3.1, API 18, revision 3
  64- SDK Platform Android 4.2.2, API 17, revision 3
  65- SDK Platform Android 4.1.2, API 16, revision 5
  66- SDK Platform Android 4.0.3, API 15, revision 5
  67- SDK Platform Android 4.0, API 14, revision 4
  68- SDK Platform Android 3.2, API 13, revision 1
  69- SDK Platform Android 3.1, API 12, revision 3
  70- SDK Platform Android 3.0, API 11, revision 2
  71- SDK Platform Android 2.3.3, API 10, revision 2
  72- SDK Platform Android 2.3.1, API 9, revision 2
  73- SDK Platform Android 2.2, API 8, revision 3
  74- SDK Platform Android 2.1, API 7, revision 3
  75- SDK Platform Android 2.0.1, API 6, revision 1 (Obsolete)
  76- SDK Platform Android 2.0, API 5, revision 1 (Obsolete)
  77- SDK Platform Android 1.6, API 4, revision 3 (Obsolete)
  78- SDK Platform Android 1.5, API 3, revision 4 (Obsolete)
  79- SDK Platform Android 1.1, API 2, revision 1 (Obsolete)
  80- Intel x86 Atom_64 System Image, Android API 29, revision 7
  81- Intel x86 Atom System Image, Android API 29, revision 7
  82- Google Play Intel x86 Atom_64 System Image, Android API 29, revision 8
  83- Google Play Intel x86 Atom System Image, Android API 29, revision 8
  84- Google APIs Intel x86 Atom_64 System Image, Android API 29, revision 9
  85- Google APIs Intel x86 Atom System Image, Android API 29, revision 9
  86- Google Play Intel x86 Atom_64 System Image, Android API R, revision 2
  87- Google Play Intel x86 Atom System Image, Android API R, revision 2
  88- Google APIs Intel x86 Atom_64 System Image, Android API R, revision 2
  89- Google APIs Intel x86 Atom System Image, Android API R, revision 2
  90- Android TV Intel x86 Atom System Image, Android API 28, revision 8
  91- Wear OS Intel x86 Atom System Image, Android API 28, revision 3
  92- Intel x86 Atom_64 System Image, Android API 28, revision 4
  93- Intel x86 Atom System Image, Android API 28, revision 4
  94- Google Play Intel x86 Atom_64 System Image, Android API 28, revision 8
  95- Google Play Intel x86 Atom System Image, Android API 28, revision 9
  96- Google APIs Intel x86 Atom_64 System Image, Android API 28, revision 9
  97- Google APIs Intel x86 Atom System Image, Android API 28, revision 10
  98- Android TV Intel x86 Atom System Image, Android API Q, revision 1
  99- Android TV Intel x86 Atom System Image, Android API 27, revision 7
 100- Intel x86 Atom_64 System Image, Android API 27, revision 1
 101- Intel x86 Atom System Image, Android API 27, revision 1
 102- Google Play Intel x86 Atom System Image, Android API 27, revision 3
 103- Google APIs Intel x86 Atom System Image, Android API 27, revision 9
 104- Android TV Intel x86 Atom System Image, Android API 26, revision 12
 105- Android Wear Intel x86 Atom System Image, Android API 26, revision 4
 106- Intel x86 Atom_64 System Image, Android API 26, revision 1
 107- Intel x86 Atom System Image, Android API 26, revision 1
 108- Google Play Intel x86 Atom System Image, Android API 26, revision 7
 109- Google APIs Intel x86 Atom_64 System Image, Android API 26, revision 14
 110- Google APIs Intel x86 Atom System Image, Android API 26, revision 14
 111- Android TV Intel x86 Atom System Image, Android API 25, revision 14
 112- Android Wear ARM EABI v7a System Image, Android API 25, revision 3
 113- Android Wear Intel x86 Atom System Image, Android API 25, revision 3
 114- Intel x86 Atom_64 System Image, Android API 25, revision 1
 115- Intel x86 Atom System Image, Android API 25, revision 1
 116- Google Play Intel x86 Atom System Image, Android API 25, revision 9
 117- Google APIs ARM 64 v8a System Image, Android API 25, revision 16
 118- Google APIs ARM EABI v7a System Image, Android API 25, revision 16
 119- Google APIs Intel x86 Atom_64 System Image, Android API 25, revision 16
 120- Google APIs Intel x86 Atom System Image, Android API 25, revision 16
 121- Android TV Intel x86 Atom System Image, Android API 24, revision 20
 122- ARM 64 v8a System Image, Android API 24, revision 7
 123- ARM EABI v7a System Image, Android API 24, revision 7
 124- Intel x86 Atom_64 System Image, Android API 24, revision 8
 125- Intel x86 Atom System Image, Android API 24, revision 8
 126- Google Play Intel x86 Atom System Image, Android API 24, revision 19
 127- Google APIs ARM 64 v8a System Image, Android API 24, revision 25
 128- Google APIs ARM EABI v7a System Image, Android API 24, revision 25
 129- Google APIs Intel x86 Atom_64 System Image, Android API 24, revision 25
 130- Google APIs Intel x86 Atom System Image, Android API 24, revision 25
 131- Android TV ARM EABI v7a System Image, Android API 23, revision 12
 132- Android TV Intel x86 Atom System Image, Android API 23, revision 19
 133- Android Wear ARM EABI v7a System Image, Android API 23, revision 6
 134- Android Wear Intel x86 Atom System Image, Android API 23, revision 6
 135- ARM EABI v7a System Image, Android API 23, revision 6
 136- Intel x86 Atom_64 System Image, Android API 23, revision 10
 137- Intel x86 Atom System Image, Android API 23, revision 10
 138- Google APIs ARM EABI v7a System Image, Android API 23, revision 31
 139- Google APIs Intel x86 Atom_64 System Image, Android API 23, revision 31
 140- Google APIs Intel x86 Atom System Image, Android API 23, revision 31
 141- Android TV Intel x86 Atom System Image, Android API 22, revision 3
 142- ARM EABI v7a System Image, Android API 22, revision 2
 143- Intel x86 Atom_64 System Image, Android API 22, revision 6
 144- Intel x86 Atom System Image, Android API 22, revision 6
 145- Google APIs ARM EABI v7a System Image, Android API 22, revision 24
 146- Google APIs Intel x86 Atom_64 System Image, Android API 22, revision 24
 147- Google APIs Intel x86 Atom System Image, Android API 22, revision 24
 148- Android TV ARM EABI v7a System Image, Android API 21, revision 3
 149- Android TV Intel x86 Atom System Image, Android API 21, revision 3
 150- ARM EABI v7a System Image, Android API 21, revision 4
 151- Intel x86 Atom_64 System Image, Android API 21, revision 5
 152- Intel x86 Atom System Image, Android API 21, revision 5
 153- Google APIs ARM EABI v7a System Image, Android API 21, revision 30
 154- Google APIs Intel x86 Atom_64 System Image, Android API 21, revision 30
 155- Google APIs Intel x86 Atom System Image, Android API 21, revision 30
 156- ARM EABI v7a System Image, Android API 19, revision 5
 157- Intel x86 Atom System Image, Android API 19, revision 6
 158- Google APIs ARM EABI v7a System Image, Android API 19, revision 38
 159- Google APIs Intel x86 Atom System Image, Android API 19, revision 38
 160- ARM EABI v7a System Image, Android API 18, revision 5
 161- Intel x86 Atom System Image, Android API 18, revision 4
 162- Google APIs ARM EABI v7a System Image, Android API 18, revision 6
 163- Google APIs Intel x86 Atom System Image, Android API 18, revision 6
 164- ARM EABI v7a System Image, Android API 17, revision 6
 165- Intel x86 Atom System Image, Android API 17, revision 4
 166- MIPS System Image, Android API 17, revision 1
 167- Google APIs ARM EABI v7a System Image, Android API 17, revision 6
 168- Google APIs Intel x86 Atom System Image, Android API 17, revision 6
 169- ARM EABI v7a System Image, Android API 16, revision 6
 170- Intel x86 Atom System Image, Android API 16, revision 6
 171- MIPS System Image, Android API 16, revision 1
 172- Google APIs ARM EABI v7a System Image, Android API 16, revision 6
 173- Google APIs Intel x86 Atom System Image, Android API 16, revision 6
 174- ARM EABI v7a System Image, Android API 15, revision 5
 175- Intel x86 Atom System Image, Android API 15, revision 5
 176- Google APIs ARM EABI v7a System Image, Android API 15, revision 6
 177- Google APIs Intel x86 Atom System Image, Android API 15, revision 6
 178- ARM EABI v7a System Image, Android API 14, revision 2
 179- ARM EABI v7a System Image, Android API 10, revision 5
 180- Intel x86 Atom System Image, Android API 10, revision 5
 181- Google APIs ARM EABI v7a System Image, Android API 10, revision 6
 182- Google APIs Intel x86 Atom System Image, Android API 10, revision 6
 183- Google APIs, Android API 24, revision 1
 184- Google APIs, Android API 23, revision 1
 185- Google APIs, Android API 22, revision 1
 186- Google APIs, Android API 21, revision 1
 187- Google APIs, Android API 19, revision 20
 188- Glass Development Kit Preview, Android API 19, revision 11 (Obsolete)
 189- Google APIs, Android API 18, revision 4
 190- Google APIs, Android API 17, revision 4
 191- Google APIs, Android API 16, revision 4
 192- Google APIs, Android API 15, revision 3
 193- Google APIs, Android API 14, revision 2 (Obsolete)
 194- Google APIs, Android API 13, revision 1 (Obsolete)
 195- Google TV Addon, Android API 13, revision 1 (Obsolete)
 196- Google APIs, Android API 12, revision 1 (Obsolete)
 197- Google TV Addon, Android API 12, revision 2 (Obsolete)
 198- Google APIs, Android API 11, revision 1 (Obsolete)
 199- Google APIs, Android API 10, revision 2 (Obsolete)
 200- Google APIs, Android API 9, revision 2 (Obsolete)
 201- Google APIs, Android API 8, revision 2 (Obsolete)
 202- Google APIs, Android API 7, revision 1 (Obsolete)
 203- Google APIs, Android API 6, revision 1 (Obsolete)
 204- Google APIs, Android API 5, revision 1 (Obsolete)
 205- Google APIs, Android API 4, revision 2 (Obsolete)
 206- Google APIs, Android API 3, revision 3 (Obsolete)
 207- Sources for Android SDK, API 29, revision 1
 208- Sources for Android SDK, API 28, revision 1
 209- Sources for Android SDK, API 27, revision 1
 210- Sources for Android SDK, API 26, revision 1
 211- Sources for Android SDK, API 25, revision 1
 212- Sources for Android SDK, API 24, revision 1
 213- Sources for Android SDK, API 23, revision 1
 214- Sources for Android SDK, API 22, revision 1
 215- Sources for Android SDK, API 21, revision 1
 216- Sources for Android SDK, API 20, revision 1
 217- Sources for Android SDK, API 19, revision 2
 218- Sources for Android SDK, API 18, revision 1
 219- Sources for Android SDK, API 17, revision 1
 220- Sources for Android SDK, API 16, revision 2
 221- Sources for Android SDK, API 15, revision 2
 222- Sources for Android SDK, API 14, revision 1 (Obsolete)
 223- Android Support Repository, revision 47
 224- Google AdMob Ads SDK, revision 11 (Obsolete)
 225- Google Analytics App Tracking SDK, revision 3 (Obsolete)
 226- Android Auto Desktop Head Unit emulator, revision 1.1
 227- Google Cloud Messaging for Android Library, revision 3 (Obsolete)
 228- Google Play services for Froyo, revision 12 (Obsolete)
 229- Google Play services, revision 49
 230- Google Play Instant Development SDK, revision 1.9
 231- Google Repository, revision 58
 232- Google Play APK Expansion library, revision 1
 233- Google Play Licensing Library, revision 1
 234- Android Auto API Simulators, revision 1
 235- Google Web Driver, revision 2

6.下载上述中所需的资源:下面的命令2和52是刚刚所列的序列号

android update sdk -u -a -t 2,52

本来我选择了下载1号资源,提示我需要依赖29.0.6

7.此时,可以用adb命令了。

 类似资料: