Install an Android Emulator on Ubuntu 22.04

Опубликовано: 12 Апрель 2023
на канале: Stateless Code
7,003
28

This one was a doozie... It had a bunch of false starts and other problems that came up, but eventually we were able to get an Android emulator installed on Ubuntu 22.04. There were so many problems trying to get this installed that we went back and added a TL;DR summary at the beginning.

We started by installing Anbox, but after installing, it wouldn't launch because the Linux kernel removed the ashmem_linux module that it relies on.

After that we install Android Studio. This is an IDE for developing on Android, and is really overbuilt for what we wanted. There is so much overhead that we ran out of space on the OS drive and had to move it to the data drive and use symbolic links.

Eventually we were able to get it up and running. Hopefully this video won't age well and a better solution will emerge. (If there's already a better one available, hit us up in the comments.)

This video covers:
00:00:00 A TL;DR summary of the video
00:02:33 Original intro for the video and install Anbox using snap
00:05:36 After rebooting try to get it running. Failed to start binder or ashmem kernel drivers not loaded
00:07:18 Attempt to install ashmem_linux kernel module. Doesn't work.
00:08:02 Try to add a PPA to get anbox dependencies installed. Doesn't work.
00:10:58 Attempt to install linux-modules-extra. Doesn't help.
00:13:25 Try to clone the anbox-modules repo and build the modules. It fails.
00:16:21 Discover that the modules needed for Anbox were removed from the Linux kernel entirely and uninstall the Anbox snap
00:17:23 Find an alternative emulator Android Studio. Download and extract.
00:22:51 Install the required libraries for Android Studio
00:24:12 Execute the shell file to launch Android Studio and do initial setup.
00:31:39 Go to Device Manager and try to create a virtual device. Need to reboot and enable Virtualization Technology in BIOS.
00:34:03 Post reboot, retry creation of virtual device
00:37:43 Creation failed due to running out of disk space again. Try to change preferences and settings to write to the data drive instead of the OS drive.
00:38:58 Show all the disk space that the different Android Studio components take up
00:40:00 Move all the Android Studio stuff to the data drive and then create symbolic links (first attempt with arguments in the wrong order)
00:43:10 Re-launch Android Studio after moving and symlinking the directories and create a virtual device
00:44:33 Virual Device successfully created. Try to launch it. It fails. Look in command line for problems. Disk space again.
00:46:10 Move the final ~/.android directory and emulator is able to launch and run in a larger window
00:48:46 Concluding thoughts

#android #androidstudio #anbox #ubuntu #linux #overbuilt #tldr #screencast #tutorials

See other related StatelessCode videos:
Setup and config video playlist    • Setup and Configuration  

Resources that we relied upon for this solution:
Android Mobile App Developer Tools https://developer.android.com/


Смотрите видео Install an Android Emulator on Ubuntu 22.04 онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Stateless Code 12 Апрель 2023, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 7,003 раз и оно понравилось 28 людям.