PacktPublishing / Learning-Embedded-Android-N-Programming

Code repository for Learning Embedded Android N Programming, published by Packt
MIT License
14 stars 10 forks source link

try to launch the emulator #1

Open SergiiGudym opened 5 years ago

SergiiGudym commented 5 years ago

Chapter 31. From zero to the screenlock I try use your line for start emulator with my img data

emulator -system /system.img -ramdisk /ramdisk.img -data /userdata.img

but got next line

emulator: ERROR: No AVD specified. Use '@foo' or '-avd foo' to launch a virtual device named 'foo'

SergiiGudym commented 5 years ago

@AndrewReitz @EstebanSannin @hamen as I understand you can help me)

EstebanSannin commented 5 years ago

Hi Sergii, just for understand, what operating system are you using?

SergiiGudym commented 5 years ago

macOS Mojave 10.14.3 Beta (18D39a)

SergiiGudym commented 5 years ago

I'm sorry to be so distract. Looks like rules changed. I'll check tomorrow. PS: emulator documentation is ugly.

emulator emulator -h emulator -? have same non informative answer emulator: ERROR: No AVD specified. Use '@foo' or '-avd foo' to launch a virtual device named 'foo'

emulator -help-disk-images

The emulator needs several key image files to run appropriately. Their exact location depends on whether you're using the emulator from the Android SDK, or not (more details below).

The minimal required image files are the following:

kernel-qemu      the emulator-specific Linux kernel image
ramdisk.img      the ramdisk image used to boot the system
system.img       the *initial* system image
userdata.img     the *initial* data partition image

It will also use the following writable image files:

userdata-qemu.img  the persistent data partition image
system-qemu.img    an *optional* persistent system image
cache.img          an *optional* cache partition image
sdcard.img         an *optional* SD Card partition image

snapshots.img      an *optional* state snapshots image

If you use a virtual device, its content directory should store all writable images, and read-only ones will be found from the corresponding platform/add-on directories. See -help-sdk-images for more details.

If you are building from the Android build system, you should have ANDROID_PRODUCT_OUT defined in your environment, and the emulator shall be able to pick-up the right image files automatically. See -help-build-images for more details.

If you're neither using the SDK or the Android build system, you can still run the emulator by explicitely providing the paths to all required disk images through a combination of the following options: -sysdir, -datadir, -kernel, -ramdisk, -system, -data, -cache -sdcard and -snapstorage.

The actual logic being that the emulator should be able to find all images from the options you give it. NOTE: In previous releases of the Android SDK, this option was named '-image'. And using '-system ' was equivalent to using '-sysdir ' now.

SergiiGudym commented 5 years ago

hm emulator -sysdir /system.img -ramdisk /ramdisk.img -data /userdata.img -kernel /kernel-qemu emulator: ERROR: No AVD specified. Use '@foo' or '-avd foo' to launch a virtual device named 'foo'