Skip to content

Commit ff70cf0

Browse files
committed
Update docs
1 parent f190510 commit ff70cf0

File tree

2 files changed

+16
-20
lines changed

2 files changed

+16
-20
lines changed

build/build_android_library.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,9 @@ collect_artifacts_to_be_uploaded() {
178178
}
179179

180180
main() {
181-
BUILD_AAR_DIR="$(mktemp -d)"
181+
if [[ -z "${BUILD_AAR_DIR:-}" ]]; then
182+
BUILD_AAR_DIR="$(mktemp -d)"
183+
fi
182184
export BUILD_AAR_DIR
183185
if [ -z "$ANDROID_ABIS" ]; then
184186
ANDROID_ABIS=("arm64-v8a" "x86_64")

examples/demo-apps/android/ExecuTorchDemo/README.md

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@ We build the required ExecuTorch runtime library (AAR) to run the model.
7171

7272
#### XNNPACK
7373

74-
1. Build the AAR target for the library with XNNPACK backend:
75-
7674
```bash
7775
# go to ExecuTorch repo root
7876
export ANDROID_NDK=<path-to-android-ndk>
@@ -81,21 +79,18 @@ export ANDROID_ABIS=arm64-v8a
8179
# Run the following lines from the `executorch/` folder
8280
./install_executorch.sh --clean
8381

82+
# Create a new directory `app/libs` for the AAR to live
83+
pushd examples/demo-apps/android/ExecuTorchDemo
84+
mkdir -p app/libs
85+
popd
86+
8487
# Build the AAR. It will include XNNPACK backend by default.
88+
export BUILD_AAR_DIR=$(realpath examples/demo-apps/android/ExecuTorchDemo/app/libs)
8589
sh build/build_android_library.sh
8690
```
8791

88-
2. In ExecuTorchDemo root, create a new directory `app/libs` and copy the AAR there.
89-
```bash
90-
# go to ExecuTorchDemo root
91-
mkdir -p app/libs
92-
cp "$BUILD_AAR_DIR/executorch.aar" app/libs
93-
````
94-
9592
#### Qualcomm Hexagon NPU
9693

97-
1. Build the AAR target for the library with XNNPACK and QNN backend:
98-
9994
```bash
10095
# go to ExecuTorch repo root
10196
export ANDROID_NDK=<path-to-android-ndk>
@@ -105,20 +100,19 @@ export QNN_SDK_ROOT=<path-to-qnn-sdk-root>
105100
# Run the following lines from the `executorch/` folder
106101
./install_executorch.sh --clean
107102

108-
# Build the AAR. It will include XNNPACK and QNN backend now.
103+
# Create a new directory `app/libs` for the AAR to live
104+
pushd examples/demo-apps/android/ExecuTorchDemo
105+
mkdir -p app/libs
106+
popd
107+
108+
# Build the AAR. It will include XNNPACK backend by default.
109+
export BUILD_AAR_DIR=$(realpath examples/demo-apps/android/ExecuTorchDemo/app/libs)
109110
sh build/build_android_library.sh
110111
```
111112

112113
This is very similar to XNNPACK setup, but users now needs to define `QNN_SDK_ROOT` so that
113114
QNN backend is built into the AAR.
114115

115-
2. In ExecuTorchDemo root, create a new directory `app/libs` and copy the AAR there.
116-
```bash
117-
# go to ExecuTorchDemo root
118-
mkdir -p app/libs
119-
cp "$BUILD_AAR_DIR/executorch.aar" app/libs
120-
````
121-
122116
## Running the App
123117

124118
1. Open the project `examples/demo-apps/android/ExecuTorchDemo` with Android Studio.

0 commit comments

Comments
 (0)