Following the directions to build AOSP, everything seems to go fine. I run:

. ./build/envsetup.sh
lunch sdk_phone_x86_64-userdebug

That seems to go fine.

Then the instructions say simply to run emulator.

user@hostname:~/WORKING_DIRECTORY$ emulator
INFO    | Android emulator version (build_id 9070145) (CL:N/A)
ERROR   | No AVD specified. Use '@foo' or '-avd foo' to launch a virtual device named 'foo'

user@hostname:~/WORKING_DIRECTORY$ emulator -list-avds

Nothing is listed. So I feel like the instructions are missing a step? How do I create an AVD?

So, I found some more instructions that say:

avdmanager create avd -n test -k "system-images;android-25;google_apis;x86"

But I'm not sure where the system[...] came from, but more importantly when I try that:

avdmanager: command not found

So again, I feel I'm missing a step.

I'm looking for a COMPLETE set of steps, from soup to nuts, to compile AOSP and run the emulator. I would like to do this from the command line and avoid having to install Android Studio.

Details on my machine:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.2 LTS
Release:        22.04
Codename:       jammy
  • You should be able to download command-line tools from the official Android Developer site down below, then download a system image using sdkmanager, then run the emulator using avdmanager.
    – Andrew T.
    Commented Jun 17, 2023 at 7:31
  • thanks @AndrewT. i'll run with that because it's all i've got, but i really am looking for COMPLETE, WORKING INSTRUCTIONS. so i go download cmdline-tools, ok i'm smart enough to unzip it, but then what? do i add the bin to my path? or do they need to be copied somewhere else? are there any library paths that need to be set? if so how? etc... Commented Jun 18, 2023 at 0:42
  • again @AndrewT. i need COMPLETE instructions. $ avdmanager ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation. Commented Jun 18, 2023 at 0:45


You must log in to answer this question.

Browse other questions tagged .