Android 编译环境 - 安装工具包

5 篇文章 0 订阅
4 篇文章 0 订阅

写个脚本,在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

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值