-
Notifications
You must be signed in to change notification settings - Fork 229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
E2E script to run on Android emulator #117
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
scripts/android_example.sh
Outdated
./gradlew :app:build | ||
popd | ||
|
||
avdmanager create avd --name "llama-fast" --package "system-images;android-34;aosp_atd;arm64-v8a" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should update to google_apis
scripts/android_example.sh
Outdated
|
||
adb adb wait-for-device | ||
adb shell mkdir /data/local/tmp/llama | ||
adb push model.pte /data/local/tmp/llama |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use stories15M.pte for example.
scripts/android_example.sh
Outdated
if [ "$(uname)" == "Darwin" -a "$(uname -p)" == "arm" ]; then | ||
JAVA_URL="https://download.oracle.com/java/17/archive/jdk-17.0.10_macos-aarch64_bin.tar.gz" | ||
SDK_MANAGER_URL="https://dl.google.com/android/repository/commandlinetools-mac-11076708_latest.zip" | ||
elif [ "$(uname)" == "Linux" -a "$(uname -p)" == "x86_64" ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uname -m instead
scripts/android_example.sh
Outdated
if [ "$(uname)" == "Darwin" -a "$(uname -p)" == "arm" ]; then | ||
export JAVA_HOME="$(pwd)"/jdk-17.0.10.jdk/Contents/Home | ||
export PATH="$JAVA_HOME/bin:$PATH" | ||
elif [ "$(uname)" == "Linux" -a "$(uname -p)" == "x86_64" ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uname -m
scripts/android_example.sh
Outdated
sdkmanager --sdk_root="${ANDROID_HOME}" --install "platform-tools" | ||
export ANDROID_NDK="$ANDROID_HOME/ndk/25.0.8775105" | ||
sdkmanager --sdk_root="${ANDROID_HOME}" --install "emulator" | ||
sdkmanager --sdk_root="${ANDROID_HOME}" --install "system-images;android-34;google_apis;arm64-v8a" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe android-26
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. Let's just use x86_64 img on x86_64...
scripts/android_example.sh
Outdated
adb shell mkdir /data/local/tmp/llama | ||
adb push model.pte /data/local/tmp/llama | ||
adb push tokenizer.bin /data/local/tmp/llama | ||
adb install -t app/build/outputs/apk/debug/app-debug.apk |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
path should be build/src/executorch/examples/demo-apps/android/LlamaDemo/app/build/outputs/apk/debug/app-debug.apk
curl "${SDK_MANAGER_URL}" -o commandlinetools.zip | ||
|
||
echo "Unzip Android SDK Manager" | ||
unzip commandlinetools.zip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
read https://developer.android.com/tools/sdkmanager to set up that directory :(
scripts/android_example.sh
Outdated
avdmanager create avd --name "llama-fast" --package "system-images;android-34;aosp_atd;arm64-v8a" | ||
sdk/emulator/emulator -sysdir $ANDROID_SDK_ROOT/system-images/android-34/google_apis/arm64-v8a/ @llama-fast & | ||
|
||
adb adb wait-for-device |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
adb
a6943b8
to
4a8d1e2
Compare
scripts/android_example.sh
Outdated
|
||
export ANDROID_HOME="$(realpath ./sdk)" | ||
export ANDROID_SDK_ROOT="$ANDROID_HOME" | ||
yes | sdkmanager --sdk_root="${ANDROID_HOME}" --licenses |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not needed
* E2E script to run on Android emulator * Simplify stuff
* E2E script to run on Android emulator * Simplify stuff
* E2E script to run on Android emulator * Simplify stuff
* E2E script to run on Android emulator * Simplify stuff
* E2E script to run on Android emulator * Simplify stuff
No description provided.