Android 编译环境 - 安装工具包

写个脚本,在ubuntu14.04 ubuntu18.04 下安装编译Android系统需要的包。

其实这种东西记录在记事本,遇到哪个系统就复制哪段得了。

#!/bin/bash

if [ ! -e /etc/lsb-release ]; then
	echo "Cannot find /etc/lsb-release"
	exit 1
fi

source /etc/lsb-release
# DISTRIB_ID=Ubuntu
# DISTRIB_RELEASE=18.04
# DISTRIB_CODENAME=bionic
# DISTRIB_DESCRIPTION="Ubuntu 18.04.2 LTS"

if [ "$DISTRIB_ID" = "Ubuntu" ]; then
	read -p "Systen is $DISTRIB_ID $DISTRIB_RELEASE, press any key to continue ..." w
	if [ "$DISTRIB_CODENAME" = "bionic" ]; then
		
		sudo apt-get install -y unzip m4 git net-tools dpkg-dev libsdl1.2-dev libesd0-dev gcc-multilib
		sudo apt-get install -y libx11-dev:i386 libreadline6-dev:i386 libncurses5-dev:i386 zlib1g-dev:i386 libc6-dev-i386

		sudo apt-get install -y git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev libc6-dev
		sudo apt-get install -y lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev libgl1-mesa-dev g++-multilib mingw32
		sudo apt-get install -y tofrodos python-markdown libxml2-utils xsltproc libssl-dev 
		sudo apt-get install -y lunch

		sudo apt-get install ccache openjdk-8-jdk
		
	elif [ "$DISTRIB_CODENAME" = "trusty" ]; then
		sudo apt-get install -y git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev libc6-dev
		sudo apt-get install -y lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev libgl1-mesa-dev g++-multilib mingw32
		sudo apt-get install -y tofrodos python-markdown libxml2-utils xsltproc libssl-dev 
		sudo apt-get install -y lunch python-software-properties
		
		sudo add-apt-repository ppa:openjdk-r/ppa
		sudo apt-get update
		sudo apt-get install -y openjdk-8-jdk
	else
		echo "The OS is not be supported"
	fi
else
	echo "The OS is not be supported"	
fi

 

你可能感兴趣的:(Android,shell,Ubuntu,android,编译,Ubuntu)