Setup Android SDK on CentOS
In this article, we are talking about how to Setup Android SDK on CentOS.
Step 1: Update your System.
One of the system administrators’ bast practice is keeping a system up to date.
$ sudo yum update
After installing the latest stable package reboot system.
$ sudo reboot
Step 2: Install JAVA
Before you can install Jenkins we need to install JAVA.
$ sudo yum install java-1.8.0-openjdk.x86_64 (Install jdk 1.8.0)
Check your java version :
$ java -version
Set environment variable for JAVA :
$ sudo cp /etc/profile /etc/profile_backup$ echo ‘export JAVA_HOME=/usr/lib/jvm/jre-1.8.0-openjdk’ | sudo tee -a /etc/profile$ echo ‘export JRE_HOME=/usr/lib/jvm/jre’ | sudo tee -a /etc/profile$ source /etc/profile
Check your environment variables :
$ echo $JAVA_HOME
$ echo $JRE_HOME
Now we can install the Android SDK on our system.
Step 2: Setup Android SDK
- Go to https://developer.android.com/studio/index.html#command-tools and copy the link address of the Linux binary.
In my case: https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip
2. Create directory: /var/lib/jenkins/android-sdk/
3. Download the zip file and unzip in the created directory
# download android sdk
sudo curl https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip -o android-sdk.zip# install unzip command
sudo apt-get install unzip OR sudo yum install unzip# unzip into this folder
sudo unzip android-sdk.zip -d .# remove the zip file
sudo rm android-sdk.zip
4. Update tools (all available packages)
sudo ./tools/bin/sdkmanager "tools"
5. Checklist of all available packages and installed
sudo ./tools/bin/sdkmanager --list
6. This step is important to accept the Android SDK license
sudo ./tools/bin/sdkmanager --licenses
🎊 🎉🤖🎊 🎉 We successfully set up the Android SDK on CentOS.
In my next article, we will talk about how can we shift this to Ansible or any other configuration management tool.
Thank you for reading, if you have anything to add please send a response or add a note!