2023-05-17 21:06:02 +03:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
case $1 in
|
|
|
|
debug|release)
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "Usage: build_and_run.sh [type] where is type is 'debug' or 'release'" >&2
|
|
|
|
exit 1
|
|
|
|
esac
|
|
|
|
|
|
|
|
type=$1
|
|
|
|
[[ ${type} == "release" ]] && release_param+=(--release)
|
|
|
|
export CPPFLAGS="-DMDB_USE_ROBUST=0" && export CFLAGS="-DMDB_USE_ROBUST=0" && cargo ndk -t arm64-v8a build ${release_param[@]}
|
|
|
|
|
2023-04-10 16:02:53 +03:00
|
|
|
if [ $? -eq 0 ]
|
|
|
|
then
|
2023-05-17 00:37:17 +03:00
|
|
|
yes | cp -f target/aarch64-linux-android/${mode}/libgrim_android.so app/src/main/jniLibs/arm64-v8a
|
2023-04-10 16:02:53 +03:00
|
|
|
./gradlew clean
|
|
|
|
./gradlew build
|
|
|
|
#./gradlew installDebug
|
|
|
|
adb install app/build/outputs/apk/debug/app-debug.apk
|
2023-04-21 03:45:59 +03:00
|
|
|
sleep 1s
|
2023-04-10 16:02:53 +03:00
|
|
|
adb shell am start -n mw.gri.android/.MainActivity
|
|
|
|
fi
|