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