-
Notifications
You must be signed in to change notification settings - Fork 284
Android ADB Guide
Jintao Meng edited this page Jun 21, 2018
·
4 revisions
This is an example to show how to test FeatherCNN on Android devices with a Ubuntu 16.04 desktop using adb tool. In the following, we illustrate necessary steps to show how it works.
- Install g++/gcc cross compiler for X86 platform and adb tools.
sudo apt-get install gcc-aarch64-linux-gnu
sudo apt-get install g++-aarch64-linux-gnu
sudo apt-get install android-tools-adb
-
Install android-ndk
Download android-ndk-r17b-linux-x86_64.zip from https://developer.android.com/ndk/downloads.
cd NDK_PATH
unzip android-ndk-r17b-linux-x86_64.zip
export NDK_ROOT=$NDK_PATH/android-ndk-r17
- Build FeatherCNN
./build_script/build_android.sh
./build_script/push_android.sh
A program named as test will be generated, and you can find 3 executable files with:
find . -name "test"
and then it outputs:
./test/libs/arm64-v8a/test
./test/obj/local/arm64-v8a/objs/test
./test/obj/local/arm64-v8a/test
- copy any one of the generated program and its related data to android devices
adb push ./test/libs/arm64-v8a/test /data/local/tmp
adb push ./data/input_3x224x224.txt /data/local/tmp
adb push ./data/mobilenet.feathermodel /data/local/tmp
- benchmarking
adb shell ./data/local/tmp/test ./data/local/tmp/mobilenet.feathermodel ./data/local/tmp/input_3x224x224.txt 10 1