C:\AndroidSDK
or ~/Android/sdk
).
C:\AndroidSDK\cmdline-tools\bin
or ~/Android/sdk/cmdline-tools/bin
).
ANDROID_HOME
C:\AndroidSDK
).ANDROID_SDK_ROOT
C:\AndroidSDK
)..bash_profile
or .zshrc
file:nano ~/.zshrc
export ANDROID_HOME=~/Android/sdk
export ANDROID_SDK_ROOT=~/Android/sdk
export PATH=$PATH:$ANDROID_HOME/platform-tools
source ~/.zshrc
sdkmanager "platform-tools"
sdkmanager "platforms;android-34"
sdkmanager "build-tools;34.0.0"
C:\AndroidSDK\platform-tools
& C:\AndroidSDK\platforms
sdkmanager "system-images;android-34;google_apis;x86_64"
sdkmanager --licenses
C:\AndroidSDK\emulator
).avdmanager create avd --name "MyAVD" --package "system-images;android-34;google_apis;x86_64"
emulator -list-avds
C:\Users\username>emulator -list-avds MyAvd
emulator -avd MyAVD
emulator -avd MyAVD -netdelay none -netspeed full -gpu on -memory 4096 -cores 4 -no-snapshot-load -feature KeyboardSupport
Command Explanation:
-avd MyAVD
: Specifies the AVD (Android Virtual Device) name.-netdelay none
: No network delay.-netspeed full
: Sets full network speed.-gpu on
: Enables GPU support.-memory 4096
: Allocates 4096 MB of RAM to the emulator.-cores 4
: Allocates 4 CPU cores.-no-snapshot-load
: Disables loading from a snapshot.-feature KeyboardSupport
: Enables keyboard input support.Common AVD Commands:
-avd <name>
: Start the emulator with the specified AVD name.-netdelay <delay>
: Set network latency (e.g., none
, gsm
,
edge
).
-netspeed <speed>
: Set network speed (e.g., full
, gsm
,
hspa
).
-no-boot-anim
: Disable the boot animation for faster startup.-no-snapshot
: Prevent saving a snapshot on exit.-no-window
: Run the emulator in headless mode (no UI window).-gpu off
: Disable GPU emulation.-writable-system
: Enable writable system partition.-camera-back <mode>
: Set the back camera (e.g., emulated
or
none
).
-scale <scale>
: Set the display scale (e.g., 0.5
for 50% size).-memory <size>
: Allocate RAM to the emulator (e.g., 2048
MB).-skin <size>
: Specify the screen size (e.g., 480x800
).-logcat *:I
: Display log messages in the emulator console.config.ini
file
C:\Users\username\.android\avd\yourAdvname.avd\
adb devices
C:\Users\"username">adb devices List of devices attached emulator-5554 device
adb -s emulator-5554 emu kill
sdkmanager --update
sdkmanager "emulator"
adb kill-server
adb start-server
adb shell mkdir /sdcard/Download
C:\Users\username>adb shell mkdir /sdcard/Download mkdir: '/sdcard/Download': File exists
adb pull /sdcard/Download/ C:\AVDFiles
adb push C:\AVDFiles\myfile.txt /sdcard/Download/
avdmanager delete avd -n MyAVD
sdkmanager --uninstall "build-tools;34.0.0" "platforms;android-34" "system-images;android-34;google_play;x86_64"