From 89b0466c5edc682e3ba9b805a5163f289a612d9c Mon Sep 17 00:00:00 2001 From: zhupengyang <1165938320@qq.com> Date: Thu, 30 May 2019 20:56:39 +0800 Subject: [PATCH] merge android arm linux emulator doc (#17749) * add android emulator document test=develop * add armlinux docker document * Error modifying document format test=develop --- paddle/fluid/lite/tools/mobile_readme.md | 27 ++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/paddle/fluid/lite/tools/mobile_readme.md b/paddle/fluid/lite/tools/mobile_readme.md index a375ac11bd5..97102367ae9 100644 --- a/paddle/fluid/lite/tools/mobile_readme.md +++ b/paddle/fluid/lite/tools/mobile_readme.md @@ -51,7 +51,18 @@ make test_fc_compute_arm -j ``` ### 在Android上执行 -#### 1. 在模拟器上执行 +#### 1. 创建模拟器(如果使用真机则跳过此步骤) + +```shell +# 创建Android avd (armv8) +$ echo n | avdmanager create avd -f -n myarmv8 -k "system-images;android-24;google_apis;arm64-v8a" +# 启动Android armv8 emulator +$ ${ANDROID_HOME}/emulator/emulator -avd myarmv8 -noaudio -no-window -gpu off -verbose & + +# armv7版本如下: +# $ echo n | avdmanager create avd -f -n myarmv7 -k "system-images;android-24;google_apis;armeabi-v7a" +# $ ${ANDROID_HOME}/emulator/emulator -avd myarmv7 -noaudio -no-window -gpu off -verbose & +``` #### 2. 上传编译文件到手机上 键盘上`crtl+q+p`同时摁下,切换到容器外(容器还在后台运行),将刚刚编译出的程序`adb push`到手机上。USB线连接手机,确保`adb devices`可以找到手机设备。 @@ -69,7 +80,19 @@ $ ./test_fc_compute_arm ### 在ARM LINUX下执行 -TBD +拉取Linux arm64镜像 +```shell +$ docker pull multiarch/ubuntu-core:arm64-bionic +``` +运行容器并在内外建立目录映射关系 +```shell +$ docker run -it --name -v : multiarch/ubuntu-core:arm64-bionic +``` +进入bin目录,并运行并文件 +```shell +$ cd +$ ./test_fc_compute_arm +``` # Q&A -- GitLab