Skip to content

title: AOSP-模拟器 layout: doc aside: false

Ubuntu 20.04

###代理

sh
export PROXY_URL=http://192.168.2.12:7890

export http_proxy=$PROXY_URL
export https_proxy=$PROXY_URL
export HTTP_PROXY=$PROXY_URL
export HTTPS_PROXY=$PROXY_URL
export all_proxy=$PROXY_URL
export ftp_proxy=$PROXY_URL
export no_proxy="localhost,127.0.0.1,.example.com"

安装repo

sh
mkdir -p ~/bin
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo

sudo apt install neovim
vim ~/.bashrc 
export PATH=~/bin:$PATH
source ~/.bashrc

安装依赖

sh
sudo apt update

sudo apt install flex bison build-essential zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 libncurses5 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z1-dev libgl1-mesa-dev libxml2-utils xsltproc fontconfig -y
sudo apt install make git-core gnupg zip unzip curl python3 openjdk-11-jdk -y

sudo apt clean && sudo apt autoremove -y

配置GIT

sh
git config --global user.email "you@example.com"
git config --global user.name "Your Name"

export PROXY_URL=http://192.168.2.12:7890
git config --global http.proxy $PROXY_URL
git config --global https.proxy $PROXY_URL

下载代码

sh
mkdir tc2 && cd tc2
export TC2_RELEASE=refs/tags/TC2-2023.10.04

repo init -u https://gitlab.arm.com/arm-reference-solutions/arm-reference-solutions-manifest \
            -m tc2.xml \
            -b ${TC2_RELEASE} \
            -g android
repo sync --fetch-submodules

安装docker

sh

sudo apt install docker.io
# ensure docker service is properly started and running
sudo systemctl restart docker
sudo chmod 777 /var/run/docker.sock


#配置代理服务
sudo mkdir -p /etc/systemd/system/docker.service.d
sudo touch /etc/systemd/system/docker.service.d/proxy.conf
sudo nano /etc/systemd/system/docker.service.d/proxy.conf
[Service]
Environment="HTTP_PROXY=http://192.168.2.12:7890/"
Environment="HTTPS_PROXY=http://192.168.2.12:7890/"
Environment="NO_PROXY=localhost,127.0.0.1,.example.com"

配置docker容器代理

sh
sudo mkdir -p ~/.docker
sudo touch ~/.docker/config.json
sudo nano ~/.docker/config.json
#输入下面内容
{
 "proxies":
 {
   "default":
   {
     "httpProxy": "http://192.168.2.12:7890",
     "httpsProxy": "http://192.168.2.12:7890",
     "noProxy": "localhost,127.0.0.1,.example.com"
   }
 }
}
#----------

#重启docker
sudo systemctl daemon-reload
sudo systemctl restart docker

编译环境

sh

export PLATFORM=tc2
export TC_GPU=swr
export TC_TARGET_FLAVOR=fvp
export FILESYSTEM=android-fvp
cd build-scripts
./setup.sh

构建

sh
export TC2_RELEASE=refs/tags/TC2-2023.10.04
export PLATFORM=tc2
export TC_GPU=swr
export TC_TARGET_FLAVOR=fvp
export FILESYSTEM=android-fvp

./run_docker.sh ./build-all.sh build

启动

sh
sudo apt-get install xterm

./run-scripts/tc2/run_model.sh -m ~/fvp_tc2/models/Linux64_GCC-9.3/FVP_TC2 -d android-fvp