Andrew Rossignol | 3247fb1 | 2017-10-27 15:15:39 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | # Quit if any command produces an error. |
| 4 | set -e |
| 5 | |
| 6 | # Build and run the CHRE simulator. |
| 7 | CHRE_HOST_OS=`uname` |
| 8 | if [[ $CHRE_HOST_OS == 'Darwin' ]]; then |
| 9 | JOB_COUNT=`sysctl -n hw.ncpu` |
| 10 | else |
| 11 | JOB_COUNT=$((`grep -c ^processor /proc/cpuinfo`)) |
| 12 | fi |
| 13 | |
| 14 | # Export the variant Makefile. |
| 15 | export CHRE_VARIANT_MK_INCLUDES=variant/android/variant.mk |
| 16 | |
Andrew Rossignol | 26f0de5 | 2017-11-02 16:02:54 -0700 | [diff] [blame] | 17 | make google_arm64_android_debug -j$JOB_COUNT |
Andrew Rossignol | 3247fb1 | 2017-10-27 15:15:39 -0700 | [diff] [blame] | 18 | adb shell setenforce 0 |
Andrew Rossignol | 26f0de5 | 2017-11-02 16:02:54 -0700 | [diff] [blame] | 19 | adb push out/google_arm64_android_debug/libchre /system/bin/chre |
Andrew Rossignol | 3247fb1 | 2017-10-27 15:15:39 -0700 | [diff] [blame] | 20 | adb push variant/android/chre-stub /vendor/bin/chre |