centos7中安装AndroidSDK的⽅法步骤本⽂介绍了centos7中安装Android SDK的⽅法步骤,分享给⼤家
0x01 下载sdktools
cd /opt
mkdir androidSdk
wget dl.google/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
-------              | -------  | -------
_apis-google-15 | 3      | Google APIs
_apis-google-16 | 4      | Google APIs
_apis-google-17 | 4      | Google APIs
_apis-google-18 | 4      | Google APIs
_apis-google-19 | 20      | Google APIs
_apis-google-21 | 1      | Google APIs
_apis-google-22 | 1      | Google APIs
_apis-google-23 | 1      | Google APIs
_apis-google-24 | 1      | Google APIs
_gdk-google-19 | 11      | Glass Development Kit Preview
build-tools;19.1.0        | 19.1.0    | Android SDK Build-Tools 19.1
socket连接不上
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
extras;_play_services | 42      | Google Play services
extras;google;instantapps    | 1.0.0    | Instant Apps Development SDK
extras;google;m2repository    | 55      | Google Repository
extras;_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
ut-solver;1.0.0 | 1      | Solver for ConstraintLayout 1.0.0 ;1.0.0-alpha2 | 1      | com. ;1.0.0-alpha3 | 1      | com. ;1.0.0-alpha4 | 1      | com. ;1.0.0-alpha5 | 1      | Solver for
;1.0.0-alpha6 | 1      | Solver for
;1.0.0-alpha7 | 1      | Solver for
;1.0.0-alpha8 | 1      | Solver for
;1.0.0-alpha9 | 1      | Solver for
ver;1.0.0-beta1 | 1      | Solver for ver;1.0.0-beta2 | 1      | Solver for ver;1.0.0-beta3 | 1      | Solver for ver;1.0.0-beta4 | 1      | Solver for ver;1.0.0-beta5 | 1      | Solver for ut-solver;1.0.1 | 1      | Solver for ConstraintLayout 1.0.1 ut-solver;1.0.2 | 1      | Solver for ConstraintLayout 1.0.2 -layout;1.0.0 | 1      | ConstraintLayout for
ut;1.0.0-alpha2 | 1      | com. ut;1.0.0-alpha3 | 1      | com. ut;1.0.0-alpha4 | 1      | com. ut;1.0.0-alpha5 | 1      | ConstraintLayout for Andr
ut;1.0.0-alpha6 | 1      | ConstraintLayout for ut;1.0.0-alpha7 | 1      | ConstraintLayout for ut;1.0.0-alpha8 | 1      | ConstraintLayout for ut;1.0.0-alpha9 | 1      | ConstraintLayout for ut;1.0.0-beta1 | 1      | ConstraintLayout for ut;1.0.0-beta2 | 1      | ConstraintLayout for ut;1.0.0-beta3 | 1      | ConstraintLayout for ut;1.0.0-beta4 | 1      | ConstraintLayout for ut;1.0.0-beta5 | 1      | ConstraintLayout for -layout;1.0.1 | 1      | ConstraintLayout for
-layout;1.0.2 | 1      | ConstraintLayout for
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
linux搜索目录下文件名
sources;android-25        | 1      | Sources for Android 25
ult;armeabi-v7a | 4      | ARM EABI v7a System Image    -10;default;x86 | 4      | Intel x86 Atom System Image
pis;armeabi-v7a | 5      | Google APIs ARM EABI le_apis;x86 | 5      | Google APIs Intel x86
ult;armeabi-v7a | 2      | ARM EABI v7a System Image
ult;armeabi-v7a | 4      | ARM EABI v7a System Image
15;default;mips | 1      | MIPS System Image
-15;default;x86 | 4      | Intel x86 Atom System Image
pis;armeabi-v7a | 5      | Google APIs ARM EABI le_apis;x86 | 5      | Google APIs Intel x86
ult;armeabi-v7a | 4      | ARM EABI v7a System Image
16;default;mips | 1      | MIPS System Image
-16;default;x86 | 5      | Intel x86 Atom System Image
pis;armeabi-v7a | 5      | Google APIs ARM EABI le_apis;x86 | 5      | Google APIs Intel x86
ult;armeabi-v7a | 5      | ARM EABI v7a System Image
17;default;mips | 1      | MIPS System Image
-17;default;x86 | 3      | Intel x86 Atom System Image
pis;armeabi-v7a | 5      | Google APIs ARM EABI le_apis;x86 | 5      | Google APIs Intel x86
ult;armeabi-v7a | 4      | ARM EABI v7a System Image
-18;default;x86 | 3      | Intel x86 Atom System Image
pis;armeabi-v7a | 5      | Google APIs ARM EABI
oogle_apis;x86 | 5      | Google APIs Intel x86
ult;armeabi-v7a | 5      | ARM EABI v7a System Image
-19;default;x86 | 5      | Intel x86 Atom System Image
pis;armeabi-v7a | 28      | Google APIs ARM EABI le_apis;x86 | 28      | Google APIs Intel x86 -tv;armeabi-v7a | 3      | Android TV ARM EABI ;android-tv;x86 | 3      | Android TV Intel x86
ult;armeabi-v7a | 4      | ARM EABI v7a System Image
代码-21;default;x86 | 4      | Intel x86 Atom System Image
;default;x86_64 | 4      | Intel x86 Atom_64 System Image
pis;armeabi-v7a | 20      | Google APIs ARM EABI le_apis;x86 | 20      | Google APIs Intel x86 le_apis;x86_64 | 20      | Google APIs Intel x86 Atom_64 ... -tv;armea
bi-v7a | 1      | Android TV ARM EABI ;android-tv;x86 | 3      | Android TV Intel x86
ult;armeabi-v7a | 2      | ARM EABI v7a System Image
-22;default;x86 | 5      | Intel x86 Atom System Image
;default;x86_64 | 5      | Intel x86 Atom_64 System Image
pis;armeabi-v7a | 14      | Google APIs ARM EABI le_apis;x86 | 14      | Google APIs Intel x86 le_apis;x86_64 | 14      | Google APIs Intel x86 Atom_64 ... -tv;armeabi-v7a | 10      | Android TV ARM EABI ;android-tv;x86 | 10      | Android TV Intel x86
ar;armeabi-v7a | 6      | Android Wear ARM EABI droid-wear;x86 | 6      | Android Wear Intel x86
-23;default;x86 | 9      | Intel x86 Atom System Image
net开源框架;default;x86_64 | 9      | Intel x86 Atom_64 System Image
pis;armeabi-v7a | 21      | Google APIs ARM EABI le_apis;x86 | 21      | Google APIs Intel x86 le_apis;x86_64 | 21      | Google APIs Intel x86 Atom_64 ... ;android-tv;x86 | 11      | Android TV Intel x86
fault;arm64-v8a | 7      | ARM 64 v8a System Image
ult;armeabi-v7a | 7      | ARM EABI v7a System Image
-24;default;x86 | 7      | Intel x86 Atom System Image
;default;x86_64 | 7      | Intel x86 Atom_64 System Image
_apis;arm64-v8a | 14      | Google APIs ARM 64 v8a System ... pis;armeabi-v7a | 14      | Google APIs ARM EABI le_apis;x86 | 14      | Google APIs Intel x86 le_apis;x86_64 | 14      | Google APIs Intel x86 Atom_64 ... s_playstore;x86 | 13      | Google Play Intel x86
;android-tv;x86 | 5      | Android TV Intel x86
ar;armeabi-v7a | 3      | Android Wear ARM EABI droid-wear;x86 | 3      | Android Wear Intel x86
_apis;arm64-v8a | 6      | Google APIs ARM 64 v8a System ... pis;armeabi-v7a | 6      | Google APIs ARM EABI le_apis;x86 | 6      | Google APIs Intel x86
le_apis;x86_64 | 6      | Google APIs Intel x86 Atom_64 ...
;android-tv;x86 | 3      | Android TV Intel x86
droid-wear;x86 | 1      | Android Wear Intel x86
le_apis;x86 | 4      | Google APIs Intel x86
s_playstore;x86 | 4      | Google Play Intel x86
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/enable hibernation
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
查看配置结果:
centos和ubuntu# adb version
Android Debug Bridge version 1.0.39
Revision 3db08f2c6889-android
Installed as /opt/androidSdk/platform-tools/adb
从结果可以看出已经可以执⾏adb 命令了.
以上就是本⽂的全部内容,希望对⼤家的学习有所帮助,也希望⼤家多多⽀持。

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。