Commit e29950484013995d7608de007bd6eb4d82d61cd6
Committed by
Richard Huang
1 parent
a0cd517c
Add Android setenv for debugging with Android Studio.
Change-Id: I408e6c378005398e37df55bdaf2c3cd320830165
Showing
3 changed files
with
50 additions
and
0 deletions
README.md
| @@ -78,8 +78,13 @@ Before running make install as normal: | @@ -78,8 +78,13 @@ Before running make install as normal: | ||
| 78 | 78 | ||
| 79 | - Ubuntu 16.04 or later | 79 | - Ubuntu 16.04 or later |
| 80 | - GCC version 6 | 80 | - GCC version 6 |
| 81 | + - Android DALi dependencies | ||
| 81 | 82 | ||
| 82 | ### Building the Repository | 83 | ### Building the Repository |
| 84 | +To download Android DALi dependencies clone https://github.com/dalihub/android-dependencies | ||
| 85 | +in your DALi folder (folder containing dali-demo). | ||
| 86 | + | ||
| 87 | + $ git clone https://github.com/dalihub/android-dependencies.git | ||
| 83 | 88 | ||
| 84 | To build the repository enter the 'build/android' folder: | 89 | To build the repository enter the 'build/android' folder: |
| 85 | 90 | ||
| @@ -93,6 +98,11 @@ For debug build: | @@ -93,6 +98,11 @@ For debug build: | ||
| 93 | 98 | ||
| 94 | $ DEBUG=1 ./build.sh | 99 | $ DEBUG=1 ./build.sh |
| 95 | 100 | ||
| 101 | +To debug from Android Studio set Android DALi enviroment using setenv script in 'build/android' and launch Android Studio from the enviroment: | ||
| 102 | + | ||
| 103 | + $ . setenv | ||
| 104 | + $ <path/to/androidstudio>/bin/studio.sh | ||
| 105 | + | ||
| 96 | To clean the build: | 106 | To clean the build: |
| 97 | 107 | ||
| 98 | $ ./build.sh clean | 108 | $ ./build.sh clean |
| @@ -102,3 +112,4 @@ To install apks: | @@ -102,3 +112,4 @@ To install apks: | ||
| 102 | $ adb install -r ./app/build/outputs/apk/debug/dali-demo-debug.apk | 112 | $ adb install -r ./app/build/outputs/apk/debug/dali-demo-debug.apk |
| 103 | $ adb install -r ./app/build/outputs/apk/release/dali-demo-release.apk | 113 | $ adb install -r ./app/build/outputs/apk/release/dali-demo-release.apk |
| 104 | 114 | ||
| 115 | + |
build/android/build.sh
| @@ -43,6 +43,10 @@ fi | @@ -43,6 +43,10 @@ fi | ||
| 43 | if [ ! -d "$ANDROID_NDK" ]; then | 43 | if [ ! -d "$ANDROID_NDK" ]; then |
| 44 | if [ -d "$ANDROID_SDK" ]; then | 44 | if [ -d "$ANDROID_SDK" ]; then |
| 45 | NDK_DIR=$(find $ANDROID_SDK -maxdepth 2 -name ndk-build | sed 's/\/ndk-build//') | 45 | NDK_DIR=$(find $ANDROID_SDK -maxdepth 2 -name ndk-build | sed 's/\/ndk-build//') |
| 46 | + # Some sdk folder structures have extra <version> dir for ndk folders. | ||
| 47 | + if [ ! -d "$NDK_DIR" ]; then | ||
| 48 | + NDK_DIR=$(find $ANDROID_SDK -maxdepth 3 -name ndk-build | sed 's/\/ndk-build//') | ||
| 49 | + fi | ||
| 46 | if [ -d "$NDK_DIR" ]; then | 50 | if [ -d "$NDK_DIR" ]; then |
| 47 | export ANDROID_NDK=$NDK_DIR | 51 | export ANDROID_NDK=$NDK_DIR |
| 48 | fi | 52 | fi |
build/android/setenv
0 → 100755
| 1 | +[ -z $ROOT_DIR ] && ROOT_DIR=$HOME | ||
| 2 | +echo "Using ROOT_DIR=\"$ROOT_DIR\"" | ||
| 3 | + | ||
| 4 | +[ -z $DALI_DIR ] && DALI_DIR=$(cd ../../../;pwd) | ||
| 5 | +echo "Using DALI_DIR=\"$DALI_DIR\"" | ||
| 6 | +export DALI_DIR=$DALI_DIR | ||
| 7 | + | ||
| 8 | +[ -z $DALI_ENV_DIR ] && DALI_ENV_DIR=$DALI_DIR/dali-env/android | ||
| 9 | +echo "Using DALI_ENV_DIR=\"$DALI_ENV_DIR\"" | ||
| 10 | +export DALI_ENV_DIR=$DALI_ENV_DIR | ||
| 11 | + | ||
| 12 | +[ -z $TARGET ] && export TARGET=armeabi-v7a | ||
| 13 | +echo "Using TARGET=\"$TARGET\"" | ||
| 14 | + | ||
| 15 | +if [ ! -d "$ANDROID_SDK" ]; then | ||
| 16 | +# try default path | ||
| 17 | + if [ -d "$ROOT_DIR/Android/Sdk" ]; then | ||
| 18 | + export ANDROID_SDK=$ROOT_DIR/Android/Sdk | ||
| 19 | + fi | ||
| 20 | +fi | ||
| 21 | +echo "Using ANDROID_SDK=\"$ANDROID_SDK\"" | ||
| 22 | + | ||
| 23 | +if [ ! -d "$ANDROID_NDK" ]; then | ||
| 24 | + if [ -d "$ANDROID_SDK" ]; then | ||
| 25 | + NDK_DIR=$(find $ANDROID_SDK -maxdepth 2 -name ndk-build | sed 's/\/ndk-build//') | ||
| 26 | + # Some sdk folder structures have extra <version> dir for ndk folders. | ||
| 27 | + if [ ! -d "$NDK_DIR" ]; then | ||
| 28 | + NDK_DIR=$(find $ANDROID_SDK -maxdepth 3 -name ndk-build | sed 's/\/ndk-build//') | ||
| 29 | + fi | ||
| 30 | + if [ -d "$NDK_DIR" ]; then | ||
| 31 | + export ANDROID_NDK=$NDK_DIR | ||
| 32 | + fi | ||
| 33 | + fi | ||
| 34 | +fi | ||
| 35 | +echo "Using ANDROID_NDK=\"$ANDROID_NDK\"" |