Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio / AVD with bumblebee / nvidia optimus

When using a computer with linux and a nvidia optimus graphics card for Android Development, is it possible to tell Intellij / Android Studio to launch the Android Virtual Devices with bumblebee?

like image 773
Eknoes Avatar asked Mar 03 '26 20:03

Eknoes


1 Answers

Yes, it is possible. I do that by using optirun but running avd and android studio separately.

For example, if you have an Android Wear image just run:

optirun ~/Android/Sdk/tools/emulator -netdelay none -netspeed full -avd Android_Wear_Square_API_<api version>

Works with regular android images as well. Its exactly the same command you use to get avd up and running via command line but you just need to prepend optirun to run it with your nvidia card.

After you do that, Android Studio will detect the emulator when you try to build and run your app, even if you don't run Android Studio using optirun.

Sources:

AVD cli docs

Optirun Docs: ArchWiki, UbuntuWiki.

Hope it helps!

like image 197
pazitos10 Avatar answered Mar 05 '26 18:03

pazitos10