File tree 1 file changed +24
-0
lines changed
1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change
1
+ #/usr/bin/env sh
2
+
3
+ ANDROID_USER_HOME="${ANDROID_USER_HOME:-$HOME/.android}"
4
+ API_LEVEL="${1:-}"
5
+
6
+ if [ -z "$API_LEVEL" ]; then
7
+ echo "Error: API level is required"
8
+ echo "Usage: create_avd <api_level>"
9
+ exit 1
10
+ fi
11
+
12
+ avd_name="Pixel_5_API_$API_LEVEL"
13
+
14
+ echo "Will create AVD: $avd_name"
15
+
16
+ avdmanager create avd \
17
+ --sdcard '8192M' \
18
+ --package "system-images;android-$API_LEVEL;google_apis;arm64-v8a" \
19
+ --name "$avd_name" \
20
+ --device 'pixel_5'
21
+
22
+ sed -i '' 's/hw\.keyboard = no/hw.keyboard = yes/' "$ANDROID_USER_HOME/avd/$avd_name.avd/config.ini"
23
+ sed -i '' 's/hw\.ramSize = .*/hw.ramSize = 4096M/' "$ANDROID_USER_HOME/avd/$avd_name.avd/config.ini"
24
+ sed -i '' 's/hw\.heapSize = .*/hw.heapSize = 1024M/' "$ANDROID_USER_HOME/avd/$avd_name.avd/config.ini"
You can’t perform that action at this time.
0 commit comments