Run Arm AI Portal text-generation models on Android
Introduction
Prepare the Android command-line tools
Build and run the default Android text-generation application
Run SmolLM2 on Android
Compare validated text-generation adapters
Verify on-device text generation
(Optional) Use an Arm AI Portal model without a validated example
Next Steps
Run Arm AI Portal text-generation models on Android
Review frequently asked questions
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.
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.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.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.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.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.