For creating an AVD off your platform build, currently there aren't good happy paths for it yet (we're working on it). A stopgap solution is to setup some default AVD in Studio (doesn't matter what the name is, let's call it 'someAvd' for now), note the path to the system image in $ANDROID_SDK_ROOT/system-images/..../x86 or x86_64, in ~/.android/avd/someAvd.avd/config.ini
Then, we can produce a img.zip in the Android build tree that contains a set of files that can replace the files in any $ANDROID_SDK_ROOT/system-images/..../x86, x86_64 folder:
echo $ANDROID_PRODUCT_OUT
MYPACKEDIMG=$1
mkdir -p $MYPACKEDIMG/img
rm -rf $MYPACKEDIMG/img/*
cd $MYPACKEDIMG/img
cp $ANDROID_PRODUCT_OUT/system-qemu.img system.img
cp $ANDROID_PRODUCT_OUT/vendor-qemu.img vendor.img
cp $ANDROID_PRODUCT_OUT/ramdisk-qemu.img ramdisk.img
if [ -f $ANDROID_PRODUCT_OUT/kernel-ranchu-64 ]; then
cp $ANDROID_PRODUCT_OUT/kernel-ranchu-64 kernel-ranchu-64
else
cp $ANDROID_PRODUCT_OUT/kernel-ranchu kernel-ranchu
fi;
cp -rf $ANDROID_PRODUCT_OUT/data .
cp -rf $ANDROID_PRODUCT_OUT/advancedFeatures.ini advancedFeatures.ini
cp -rf $ANDROID_PRODUCT_OUT/userdata.img .
cp -rf $ANDROID_PRODUCT_OUT/encryptionkey.img .
cp -rf $ANDROID_PRODUCT_OUT/system/build.prop .
cp -rf $ANDROID_PRODUCT_OUT/VerifiedBootParams.textproto .
cp -rf $ANDROID_PRODUCT_OUT/source.properties .
cd ..
zip -1rq img.zip img/*
ls -l img.zip
After replacing the files there, wiping AVD data and launching the AVD 'someAvd' from Studio should work.