I use Android Studio 2.1.3. When I run an Android app I pick an AVD, where can I pass command line options such as -http-proxy
? I don't even find a way in the run configuration.
Starting the emulator Use the emulator command to start the emulator, as an alternative to running your project or starting it through the AVD Manager. Here's the basic command-line syntax for starting a virtual device from a terminal prompt: emulator -avd avd_name [ {- option [ value ]} … ]
Open a command line—from Android Studio, select View > Tool Windows > Terminal—and navigate to the directory where your unsigned APK is located. zipalign ensures that all uncompressed data starts with a particular byte alignment relative to the start of the file, which may reduce the amount of RAM consumed by an app.
The Android SDK Command-Line Tools package contains various tools for building and debugging Android apps. It is released concurrently with Android Studio and is installed in the android_sdk /cmdline-tools/ version /bin/ directory.
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:
Rename the binary to emulator-original
Create a bash script with the name emulator
that contains:
/Users/<YOUR_USERNAME>/Library/Android/sdk/emulator/emulator-original <PARAMS> $@```
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With