1#!/bin/bash
2set -eu
3
4# Usage: update_prebuilt.sh BUILD_ID
5
6if [ -z "${1+x}" ]
7then
8    echo "build id is required"
9    exit 1
10fi
11
12function downloadApp {
13    TARGET=car_apps_gradle-all
14    # See go/fetch_artifact for details on fetch_artifact. To install it use:
15    # sudo glinux-add-repo android stable && \
16    # sudo apt update && \
17    # sudo apt install android-fetch-artifact
18
19    CMD="fetch_artifact --bid $1 --target $TARGET --use_oauth2"
20
21    $CMD $2 $3
22}
23
24
25cd $(dirname $0)
26
27downloadApp $1 "CarMediaApp_aaos_cert.apk" "CarMediaApp.apk"
28
29echo "Done. Don't forget to test and commit the new artifact."
30