Android Emulator on Linux
Download
https://developer.android.com/studio/index.html?hl=sk
Extract
sudo mkdir /opt/android-studio
sudo tar xvzf ~/Downloads/android-studio-ide-192.6308749-linux.tar.gz -C /opt/
Install requirments for 64-bit machine
sudo apt update && sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1 libbz2-1.0:i386
Optional KVM Install
sudo apt install qemu-kvm libvirt-bin ubuntu-vm-builder bridge-utils
sudo adduser `id -un` libvirtd
sudo adduser `id -un` kvm
sudo reboot
#./emulator64-x86 -avd < your AVD name> -qemu -m 2047 -enable-kvm
Configure Android Studio
cd /opt/android-studio/bin/
./studio.sh
Create desktop/App shortcuts
echo '#!/usr/bin/env xdg-open' > ~/Desktop/AndroidStudio.desktop
echo '[Desktop Entry]' >> ~/Desktop/AndroidStudio.desktop
echo 'Version=1.0' >> ~/Desktop/AndroidStudio.desktop
echo 'Type=Application' >> ~/Desktop/AndroidStudio.desktop
echo 'Terminal=false' >> ~/Desktop/AndroidStudio.desktop
echo 'Exec=/opt/android-studio/bin/studio.sh' >> ~/Desktop/AndroidStudio.desktop
echo 'Name=Android Studio' >> ~/Desktop/AndroidStudio.desktop
echo 'Comment=Android Studio' >> ~/Desktop/AndroidStudio.desktop
echo 'Icon=/opt/android-studio/bin/studio.png' >> ~/Desktop/AndroidStudio.desktop
chmod +x ~/Desktop/AndroidStudio.desktop
# trust and launch
cp ~/Desktop/AndroidStudio.desktop ~/.local/share/applications/
Extra Configurations
# install adb or update path to current adb
sudo apt update && sudo apt install adb
# add to .profile or run each time
export PATH=$PATH:$HOME"/Android/Sdk/platform-tools/"
# See my post here about how to download apk files
adb install <</path/file.apk>>
# Remove root from emulated device
adb unroot
Mount KVM host file system (if running in VM)
# Look here on how to create pass-through
mkdir /tmp/host_files
# add to .profile or run each time
sudo mount -t 9p -o trans=virtio,version=9p2000.L /Downloads /tmp/host_files
ls /tmp/host_files/
References
Comments
Post a Comment
Comments with irrelevant links will be deleted.