Ubuntu 18.04 - Install Android Emulator

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

https://www.ubuntupit.com/top-android-emulators-for-linux-to-enjoy-android-apps-in-linux/
https://developer.android.com/studio/install?hl=sk
https://developer.android.com/studio/run/emulator-acceleration?utm_source=android-studio#vm-linux
https://stackoverflow.com/questions/36526021/kvm-installation-unable-to-locate-package-ia32-libs-multiarch
http://www.linux-kvm.org/page/9p_virtio
https://askubuntu.com/questions/652936/adding-android-sdk-platform-tools-to-path-downloaded-from-umake
https://linuxconfig.org/how-to-create-desktop-shortcut-launcher-on-ubuntu-18-04-bionic-beaver-linux
https://askubuntu.com/questions/6897/where-to-install-programs
https://www.tecmint.com/install-kernel-headers-in-ubuntu-and-debian/
https://www.cyberciti.biz/faq/how-to-add-to-bash-path-permanently-on-linux/
https://askubuntu.com/questions/79583/adding-custom-applications-to-gnome-launcher


Comments

Popular posts from this blog

Azure DevOps - Auto Approve PR with PAT

Ansible Module - VMWare Update Guest PCI Device