Frequently Asked Question
5. Android Studio on Kali Linux
Android Studio is not a penetration testing tool in itself, but it serves as a crucial component and environment for performing Android application penetration testing. Its role in the process is multifaceted.
Emulator and Virtual Device Management:-
Android Studio provides a built-in emulator that allows penetration testers to create and manage virtual Android devices. These emulators are essential for testing applications in a controlled environment without needing physical devices, and they can be configured with various Android versions and device specifications to simulate different testing scenarios.
Debugging and Code Analysis:-
The integrated development environment (IDE) features of Android Studio, including its debugger, enable testers to step through application code, analyze its behavior, and identify potential vulnerabilities like insecure data storage, weak encryption, or improper authentication implementations.
Application Building and Modification:-
Testers can use Android Studio to build and modify Android applications. This is useful for creating custom test applications, developing proof-of-concept exploits, or patching existing applications to bypass security controls during testing.
Integration with Other Tools:-
Android Studio facilitates integration with other specialized penetration testing tools. For instance, it can be used in conjunction with proxy tools like Burp Suite or OWASP ZAP to intercept and analyze network traffic from the application running on an emulator.
Understanding the Android Ecosystem:-
Familiarity with Android Studio and the Android development process provides a deeper understanding of how Android applications are built and how security features are implemented, which is crucial for identifying potential weaknesses and attack vectors.
Prerequisites before diving in, to ensure system meets the requirements:-
- OS: Kali Linux 2025 (64-bit)
- RAM: 8GB (16GB recommended)
- CPU: x86_64 architecture, 2nd-gen Intel Core or newer, or AMD with AMD-V/SSSE3 support
- Disk Space: At least 8GB for IDE, SDK, and emulator
- Java: Oracle JDK or OpenJDK installed
- Internet: Stable connection for downloading dependencies
# Setup
- Install Java (JDK) Android Studio requires a Java Development Kit. Install OpenJDK by opening a terminal and running:-
- Verify the installation:-
- Download the latest installer version from https://developer.android.com
- Locate the Downloads directory, or where the downloaded Android Studio installation file from their official website.
- Then run the following command, replacing the file name android-studio-2025.1.1.14-linux.tar.gz with the appropriate name of your downloaded file:-
- Navigate into the Downloads directory by using below command:
- Extract Android Studio with tar:-
- Wait for the extraction process to complete.
- After successful extraction, you can use the ls command to list all the files that were extracted from running the previous commands.
- Based on the listed files, navigate into the Android Studio directory by using below command:
- Launch Android Studio. Navigate to the Android Studio binary folder and start the IDE::-
- On first launch, the Setup Wizard will guide you. Choose “Do not import settings” if it’s a fresh install, and accept the default settings for SDK components. The wizard downloads necessary tools, which may take time depending on your internet speed.
$ sudo apt update
$ sudo apt install openjdk-17-jdk$ java -version$ cp android-studio-2025.1.1.14-linux.tar.gz Downloads/$ cd Downloads/$ tar -xzvf android-studio-2025.1.1.14-linux.tar.gz$ cd android-studio/bin$ ./studio.sh
or
$ ./studio# Create Virtual Device
- On the "Welcome to Android Studio" screen, select More Actions.
- Click Virtual Device Manager.
- Click on the + icon to add a new device.
- Choose a device based on your preferences.
- Select an x86 image (we recommend Android 7 or higher) with Google APIs but not Google Play to use a non-production image.
- If you encounter issues with Intel HAXM, install KVM for virtualization:-
- Verify KVM support:-
$ sudo apt install qemu-kvm libvirt-daemon-system$ kvm-ok# Set Environment Variables
- Open the bashrc file:-
- Add below at the end of the file:-
- To save & exit the file editing, press Ctrl + o then Ctrl + x
- Execute the bashrc file to make the changes effective:-
- To check if variables are added:-
$ nano ~/.bashrcexport ANDROID_HOME=$HOME/Android/Sdk
export ANDROID_SDK_ROOT=$HOME/Android/Sdk
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/platform-tools
export PATH=$PATH:/home/kali/Android/Sdk/emulator$ bash
$ source ~/.bashrc$ echo $PATH
$ echo $ANDROID_SDK_ROOT
$ echo $ANDROID_HOME# Run the Virtual Device in the Terminal
- With the following command, the virtual device should be shown on the screen:-
$ emulator -avd device-name -writable-system -no-snapshot# Troubleshooting Tips
- If virtualization is disabled, enable Intel VT-x or AMD-V in your BIOS.
- ADB Errors: If you encounter “Unable to detect ADB version,” ensure the Android SDK path is correct. Run adb kill-server and adb start-server in /opt/android-studio/sdk/platform-tools.
- Slow Performance: Ensure you have enough RAM and disk space. Use a physical device instead of an emulator if performance lags.
- Updates: Check for updates via Help ⟶ Check for Update to keep Android Studio current.