forked from vedderb/vesc_tool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_android
executable file
·51 lines (42 loc) · 1.67 KB
/
build_android
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
47
48
49
50
#!/bin/bash
set -e
export ANDROID_HOME=~/Android/Latest
export ANDROID_NDK_HOST=linux-x86_64
export ANDROID_NDK_PLATFORM=android-23
export ANDROID_NDK_TOOLCHAIN_VERSION=4.9
export ANDROID_API_VERSION=android-23
export ANDROID_NDK_ROOT=$ANDROID_HOME/Ndk
export ANDROID_SDK_ROOT=$ANDROID_HOME/Sdk
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64
export PATH=$PATH:$ANDROID_HOME/Sdk/tools:/usr/bin:$JAVA_HOME/bin
rm -rf build/android/*
# armv7
export PATH=/opt/Qt3/5.12.7/android_armv7/bin/:$PATH
export ANDROID_NDK_TOOLCHAIN_PREFIX=arm-linux-androideabi
export ANDROID_NDK_TOOLS_PREFIX=arm-linux-androideabi
# Mobile
qmake -config release "CONFIG += release_android build_mobile"
make clean
make -j8
make install INSTALL_ROOT=build/android/build
androiddeployqt --gradle --no-gdbserver --output build/android/build --input android-libvesc_tool.so-deployment-settings.json --android-platform android-29
mv build/android/build/build/outputs/apk/build-debug.apk build/android/vesc_tool_mobile.apk
rm -rf build/android/build
rm -rf build/android/obj
rm -f build/android/libvesc_tool.so
# Full
qmake -config release "CONFIG += release_android"
make clean
make -j8
make install INSTALL_ROOT=build/android/build
androiddeployqt --gradle --no-gdbserver --output build/android/build --input android-libvesc_tool.so-deployment-settings.json --android-platform android-29
mv build/android/build/build/outputs/apk/build-debug.apk build/android/vesc_tool_full.apk
rm -rf build/android/build
rm -rf build/android/obj
rm -f build/android/libvesc_tool.so
# Zip APKs
cd build/android
zip vesc_tool_android.zip vesc_tool_mobile.apk vesc_tool_full.apk
rm -f vesc_tool_mobile.apk
rm -f vesc_tool_full.apk
cd ../..