blob: c32ea2e4f2e7eca3ca59fb548a6cd2ee62b940a1 [file] [log] [blame]
Lingfeng Yang45bb29b2020-02-15 11:31:26 -08001#!/bin/bash
2# Find builds here:
3# https://android-build.googleplex.com/builds/branches/aosp-emu-master-dev/grid?
4set -e
5
6function update_binaries {
7 local src="$1"
8 local dst="$2"
9
10 rm -rf "$dst"
11 rm -rf "emulator"
12 unzip "$src"
13 rm -f "./emulator/emulator64-crash-service"
14 rm -f "./emulator/emulator64-mips"
15 rm -f "./emulator/qemu/linux-x86_64/qemu-system-mipsel"
16 rm -f "./emulator/qemu/linux-x86_64/qemu-system-mips64el"
17 mv "emulator" "$dst"
18 git add "$dst"
19}
20
21if [ $# == 1 ]
22then
23build=$1
24else
25 echo Usage: $0 build
26 exit 1
27fi
28
29linux_zip="sdk-repo-linux-emulator-$build.zip"
30
31echo Fetching Linux $build
32/google/data/ro/projects/android/fetch_artifact --bid $build --target sdk_tools_linux "$linux_zip"
33update_binaries "$linux_zip" "linux-x86_64"
34
35printf "Upgrade emulator to emu-master-dev build $build\n\n" > emulator.commitmsg
36
37git commit -s -t emulator.commitmsg
38
39rm -f "emulator.commitmsg"
40rm -f "$linux_zip"