Skip to content

Commit 1aec012

Browse files
authored
Update README.md to include support for Android Emulator (#29)
1 parent d82bd06 commit 1aec012

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

dl3/android/DeepLabV3Demo/README.md

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,16 @@ This guide explains how to setup ExecuTorch for Android using a demo app. The ap
99
## Step 1: Export the model
1010
Run the script in `dl3/python/export.py` to export the model.
1111

12-
## Step 2: Push the model to the phone
13-
The app loads a hardcoded model path (`/data/local/tmp/dl3_xnnpack_fp32.pte`) on the phone.
14-
Run the following adb command to push the model.
15-
```
16-
adb push dl3_xnnpack_fp32.pte /data/local/tmp/dl3_xnnpack_fp32.pte
17-
```
12+
## Step 2: Set up your device or emulator
13+
You can run the app on either a physical device or an emulator. To set up your device or emulator, follow these steps:
14+
15+
### Using a Physical Device
16+
* Connect your device to your computer via USB.
17+
* Enable USB debugging on your device.
18+
19+
### Using an Emulator
20+
* Open Android Studio and create a new virtual device.
21+
* Start the emulator by clicking the "Play" button next to the device name.
1822

1923
## Step 3: Build, install, and run the app on your phone
2024
### On your terminal
@@ -26,9 +30,16 @@ adb shell am start -W -S -n org.pytorch.executorchexamples.dl3/.MainActivity
2630

2731
### On Android Studio
2832
Open Android Studio and open the project path `dl3/android/DeepLanV3Demo`. Wait for gradle sync to complete.
29-
Then simply press "Run app" button (Control + r).
33+
Then simply press "Run app" button (Control + r) to run the app either on physical device / emulator.
34+
35+
## Step 4: Push the model to the phone or emulator
36+
The app loads a hardcoded model path (`/data/local/tmp/dl3_xnnpack_fp32.pte`) on the phone.
37+
Run the following adb command to push the model.
38+
```
39+
adb push dl3_xnnpack_fp32.pte /data/local/tmp/dl3_xnnpack_fp32.pte
40+
```
3041

31-
## Step 4: Run unit test
42+
## Step 5: Run unit test
3243
### On your terminal
3344
```
3445
./gradlew connectedAndroidTest

0 commit comments

Comments
 (0)