How to pass command line options to the emulator in Android Studio?

I found a hacky solution to add parameters to the Android Studio AVD.

Android Studio by default uses the binary $ANDROID_SDK/emulator/emulator. In my case the path in MacOS is /Users/martin/Library/Android/sdk/emulator/emulator. What I did is:

  1. Rename the binary to emulator-original

  2. Create a bash script with the name emulator that contains:

    /Users/<YOUR_USERNAME>/Library/Android/sdk/emulator/emulator-original <PARAMS> $@```
    
    
  3. Change the script permissions with chmod +x emulator

Now Android Studio runs my script instead of running the binary

Update: try Stef’s solution first, it looks better than this hack

Leave a Comment