AVD - Android Virtual Device
- Do you work in a cybersecurity company? Do you want to see your company advertised in HackTricks? or do you want to have access to the latest version of the PEASS or download HackTricks in PDF? Check the SUBSCRIPTION PLANS!
Android Studio allows to run virtual machines of Android that you can use to test APKs. In order to use them you will need:
In Windows (in my case) after installing Android Studio I had the SDK Tools installed in:
C:\Users\<UserName>\AppData\Local\Android\Sdk\tools
In mac you can download the SDK tools and have them in the PATH running:
brew tap homebrew/cask
brew install --cask android-sdk
Or from Android Studio GUI as indicated in https://stackoverflow.com/questions/46402772/failed-to-install-android-sdk-java-lang-noclassdeffounderror-javax-xml-bind-a which will install them in
~/Library/Android/sdk/cmdline-tools/latest/bin/
and ~/Library/Android/sdk/platform-tools/
and ~/Library/Android/sdk/emulator/
For the Java problems:
export JAVA_HOME=/Applications/Android\ Studio.app/Contents/jbr/Contents/Home
If you installed Android Studio, you can just open the main project view and access: Tools --> AVD Manager.

Then, click on Create Virtual Device

select the phone you want to use and click on Next.
If you need a phone with Play Store installed select one with the Play Store icon on it!

In the current view you are going to be able to select and download the Android image that the phone is going to run:

So, select it and if it isn't downloaded click on the Download symbol next to the name (now wait until the image is downloaded).
Once the image is downloaded, just select
Next
and Finish
.The virtual machine will be created. Now every time that you access AVD manager it will be present.
In order to run it just press the Start button.

First of all you need to decide which phone you want to use, in order to see the list of possible phones execute:
C:\Users\<UserName>\AppData\Local\Android\Sdk\tools\bin\avdmanager.bat list device