1#!/bin/bash 2set -eux 3 4PYTORCH_DIR="$(cd $(dirname $0)/..; pwd -P)" 5PYTORCH_ANDROID_DIR=$PYTORCH_DIR/android 6 7echo "PYTORCH_DIR:$PYTORCH_DIR" 8 9source "$PYTORCH_ANDROID_DIR/common.sh" 10 11check_android_sdk 12check_gradle 13parse_abis_list "$@" 14build_android 15 16# To set proxy for gradle add following lines to ./gradle/gradle.properties: 17# systemProp.http.proxyHost=... 18# systemProp.http.proxyPort=8080 19# systemProp.https.proxyHost=... 20# systemProp.https.proxyPort=8080 21 22if [ "$CUSTOM_ABIS_LIST" = true ]; then 23 NDK_DEBUG=1 $GRADLE_PATH -PnativeLibsDoNotStrip=true -PABI_FILTERS=$ABIS_LIST -p $PYTORCH_ANDROID_DIR clean test_app:assembleDebug 24else 25 NDK_DEBUG=1 $GRADLE_PATH -PnativeLibsDoNotStrip=true -p $PYTORCH_ANDROID_DIR clean test_app:assembleDebug 26fi 27 28find $PYTORCH_ANDROID_DIR -type f -name *apk 29 30find $PYTORCH_ANDROID_DIR -type f -name *apk | xargs echo "To install apk run: $ANDROID_HOME/platform-tools/adb install -r " 31