Who is this for?

This Learning Path is for Android and machine learning developers who want to run optimized text-generation and text-embedding models locally on an Arm-based Android phone.

What will you learn?

Upon completion of this Learning Path, you will be able to:

  • Prepare the Android command-line tools and connect an Arm-based Android phone.
  • Download and run an ExecuTorch text-generation model from the Arm AI Portal.
  • Understand how the starter application uses model catalog entries and runtime adapters.
  • Compare the validated ExecuTorch and ONNX Runtime GenAI adapter paths.

Prerequisites

Before starting, you will need the following:

  • A macOS, Linux, or Windows development machine with Git, Python 3.10 or later, and JDK 17
  • Tools for downloading and extracting ZIP archives on the machine
  • An Arm-based Android phone with enough free storage for application and model files
  • A data-capable USB cable
  • A Hugging Face account with access to the model repositories
  • Basic familiarity with terminal commands and Android applications
  • Network access for the first Gradle build and model downloads

Summary

AI-assisted

This summary was drafted with an approved AI-assisted workflow and reviewed by Arm contributors before publication. Human technical review remains part of the process so the final page reflects engineering rigor, accuracy, and Arm editorial standards.

Close
?
You’ll prepare Android command-line tools, connect an Arm-based phone, and run a validated Arm AI Portal text-generation model locally. First, you’ll download SmolLM2 360M Instruct and build the starter application with its ExecuTorch adapter. Next, you’ll copy the model into application-private storage and verify generated text offline. You’ll also compare the ONNX Runtime GenAI adapter path and optionally prepare to support another model.

Frequently asked questions

AI-assisted

These FAQs were drafted with an approved AI-assisted workflow and reviewed by Arm contributors before publication. Human technical review remains part of the process so the final page reflects engineering rigor, accuracy, and Arm editorial standards.

Close
?
How do I know adb is ready to use my phone?
Run adb devices -l and look for your device marked device with a serial number. If it shows unauthorized, unlock the phone and accept the USB debugging prompt. On Windows, you might also need the phone manufacturer’s USB driver.
Where should I place the model files on the device?
The application loads models from filesDir/models/<model-id>/. For development, stage the package under /data/local/tmp and use the run-as command to copy it into the application’s private directory.
Which identifiers do I use to run the starter application?
Use ANDROID_PACKAGE=com.arm.learningpath.texttotext and MODEL_ID=smollm2-360m-instruct-8da4w-xnnpack-executorch. Keep the identifiers consistent with the entries in model_catalog.json.
How do I switch between ExecuTorch and ONNX Runtime GenAI adapters?
ui/MainActivity.kt reads the selected entry from model_catalog.json, and inference/RuntimeRunnerFactory.kt creates the adapter named by its runtime field. Select the validated catalog entry for the runtime you want to use.
How do I confirm that the sample runs offline?
Enable airplane mode and run the prompts again. Expect relevant, readable text without prompt echoes, role markers, tokenizer control tokens, or runtime diagnostics. This confirms that the model generates responses on-device without a network connection.
Next