Android sdk 搭建

2018/4/21 posted in  Android

Step 1. Download and Install Android SDK.

mkdir -p /opt/sdk-tools-linux-3859397
cd /opt/sdk-tools-linux-3859397
sudo wget https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip
sudo unzip sdk-tools-linux-3859397.zip
cd /opt
sudo chown -R root:root sdk-tools-linux-3859397
sudo ln -s sdk-tools-linux-3859397 android-sdk

Step 2. Set Android SDK Environment Value.

 sudo vim /etc/profile.d/android-sdk-env.sh

export ANDROID_HOME="/opt/android-sdk"
export PATH="$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$PATH"

sudo source /etc/profile.d/android-sdk-env.sh

Step 3.1 Update Android SDK.

cd /opt/android-sdk/tools
sudo ./android update sdk --no-ui

Step 3.2 Update Android SDK.

Use Command Line to Update Android SDK

This is an example.

/opt/android-sdk/tools/bin/sdkmanager --list
/opt/android-sdk/tools/bin/sdkmanager "tools" "build-tools;26.0.0" "extras;android;m2repository" "extras;google;google_play_services" "platforms;android-26" "platform-tools"
Posted by Moon Light February 1, 2016   android

更新sdk 版本

android update sdk --no-ui --all --filter "android-23"

android update sdk -u -t tool,platform-tool -a

yum install java-devel