fix imports, make emulator run on system architecture
This commit is contained in:
+5
-4
@@ -30,13 +30,14 @@
|
||||
version = [ "27.1.12297006" ];
|
||||
};
|
||||
};
|
||||
enterShell = ''
|
||||
# The emulator's bundled libs are only needed on Linux; macOS uses DYLD paths.
|
||||
enterShell = lib.optionalString pkgs.stdenv.isLinux ''
|
||||
export LD_LIBRARY_PATH=$ANDROID_HOME/emulator/lib64:$LD_LIBRARY_PATH
|
||||
'';
|
||||
# Use a system image matching the host CPU (arm64 on Apple Silicon, x86_64 elsewhere).
|
||||
scripts.create-avd.exec = ''
|
||||
if [ ! -f .avd-created ]; then
|
||||
avdmanager create avd -n "Pixel_5_API34" -k "system-images;android-34;google_apis_playstore;x86_64" -d "pixel_5";
|
||||
touch .avd-created;
|
||||
if ! avdmanager list avd -c | grep -qx "Pixel_5_API34"; then
|
||||
echo no | avdmanager create avd -n "Pixel_5_API34" -k "system-images;android-34;google_apis_playstore;${if pkgs.stdenv.hostPlatform.isAarch64 then "arm64-v8a" else "x86_64"}" -d "pixel_5"
|
||||
fi
|
||||
'';
|
||||
<@endif>
|
||||
|
||||
Reference in New Issue
Block a user