diff options
author | Anton Obzhirov <a.obzhirov@samsung.com> | 2020-03-24 09:59:15 +0000 |
---|---|---|
committer | Richard Huang <r.huang@samsung.com> | 2020-03-27 16:18:11 +0000 |
commit | e29950484013995d7608de007bd6eb4d82d61cd6 (patch) | |
tree | 459d10814feb8872a22740aceaea8bfc5565a31d | |
parent | a0cd517c9ade387b02015082d58ce8c1558caa77 (diff) | |
download | dali-demo-e29950484013995d7608de007bd6eb4d82d61cd6.tar.gz dali-demo-e29950484013995d7608de007bd6eb4d82d61cd6.tar.bz2 dali-demo-e29950484013995d7608de007bd6eb4d82d61cd6.zip |
Add Android setenv for debugging with Android Studio.
Change-Id: I408e6c378005398e37df55bdaf2c3cd320830165
-rw-r--r-- | README.md | 11 | ||||
-rwxr-xr-x | build/android/build.sh | 4 | ||||
-rwxr-xr-x | build/android/setenv | 35 |
3 files changed, 50 insertions, 0 deletions
@@ -78,8 +78,13 @@ Before running make install as normal: - Ubuntu 16.04 or later - GCC version 6 + - Android DALi dependencies ### Building the Repository +To download Android DALi dependencies clone https://github.com/dalihub/android-dependencies +in your DALi folder (folder containing dali-demo). + + $ git clone https://github.com/dalihub/android-dependencies.git To build the repository enter the 'build/android' folder: @@ -93,6 +98,11 @@ For debug build: $ DEBUG=1 ./build.sh +To debug from Android Studio set Android DALi enviroment using setenv script in 'build/android' and launch Android Studio from the enviroment: + + $ . setenv + $ <path/to/androidstudio>/bin/studio.sh + To clean the build: $ ./build.sh clean @@ -102,3 +112,4 @@ To install apks: $ adb install -r ./app/build/outputs/apk/debug/dali-demo-debug.apk $ adb install -r ./app/build/outputs/apk/release/dali-demo-release.apk + diff --git a/build/android/build.sh b/build/android/build.sh index 6e0bf9f9..09fa1700 100755 --- a/build/android/build.sh +++ b/build/android/build.sh @@ -43,6 +43,10 @@ fi if [ ! -d "$ANDROID_NDK" ]; then if [ -d "$ANDROID_SDK" ]; then NDK_DIR=$(find $ANDROID_SDK -maxdepth 2 -name ndk-build | sed 's/\/ndk-build//') + # Some sdk folder structures have extra <version> dir for ndk folders. + if [ ! -d "$NDK_DIR" ]; then + NDK_DIR=$(find $ANDROID_SDK -maxdepth 3 -name ndk-build | sed 's/\/ndk-build//') + fi if [ -d "$NDK_DIR" ]; then export ANDROID_NDK=$NDK_DIR fi diff --git a/build/android/setenv b/build/android/setenv new file mode 100755 index 00000000..c85e935e --- /dev/null +++ b/build/android/setenv @@ -0,0 +1,35 @@ +[ -z $ROOT_DIR ] && ROOT_DIR=$HOME +echo "Using ROOT_DIR=\"$ROOT_DIR\"" + +[ -z $DALI_DIR ] && DALI_DIR=$(cd ../../../;pwd) +echo "Using DALI_DIR=\"$DALI_DIR\"" +export DALI_DIR=$DALI_DIR + +[ -z $DALI_ENV_DIR ] && DALI_ENV_DIR=$DALI_DIR/dali-env/android +echo "Using DALI_ENV_DIR=\"$DALI_ENV_DIR\"" +export DALI_ENV_DIR=$DALI_ENV_DIR + +[ -z $TARGET ] && export TARGET=armeabi-v7a +echo "Using TARGET=\"$TARGET\"" + +if [ ! -d "$ANDROID_SDK" ]; then +# try default path + if [ -d "$ROOT_DIR/Android/Sdk" ]; then + export ANDROID_SDK=$ROOT_DIR/Android/Sdk + fi +fi +echo "Using ANDROID_SDK=\"$ANDROID_SDK\"" + +if [ ! -d "$ANDROID_NDK" ]; then + if [ -d "$ANDROID_SDK" ]; then + NDK_DIR=$(find $ANDROID_SDK -maxdepth 2 -name ndk-build | sed 's/\/ndk-build//') + # Some sdk folder structures have extra <version> dir for ndk folders. + if [ ! -d "$NDK_DIR" ]; then + NDK_DIR=$(find $ANDROID_SDK -maxdepth 3 -name ndk-build | sed 's/\/ndk-build//') + fi + if [ -d "$NDK_DIR" ]; then + export ANDROID_NDK=$NDK_DIR + fi + fi +fi +echo "Using ANDROID_NDK=\"$ANDROID_NDK\"" |