Install and Use ADB Tool in Kali Linux

 Install and Use ADB Tool in Kali Linux

What is ADB?

ADB is part of the Android SDK Platform Tools and acts as a bridge between your computer and an Android device. It allows you to:

  • Install and debug applications.
  • Access the Android file system.
  • Execute shell commands on the device.
  • Perform port forwarding for network-related tasks.

For ethical hackers and pentesters, ADB is particularly useful for application testing and network traffic analysis.

Step 1: Installation

 a. Type the command to ensure your system is upto date-

sudo apt update && sudo apt upgrade -y

b. Install ADB using your package manager:

sudo apt-get install adb  
or 
apt-get install adb (inroot access)


c. Verify the Installation

After installation, check the ADB version to confirm it’s installed correctly:

adb version 

Step 2: Install Genymotion

If you haven’t installed Genymotion yet, follow these steps:

1. Download Genymotion

  1. Go to the Genymotion website.
  2. Log in or create an account.
  3. Download the Linux 64-bit version. 

Add a Virtual Device

  1. In Genymotion, log in with your account.
  2. Click + Add to add a virtual device.
  3. Select a device (e.g., Pixel 4 with Android 10) and download it.
  4. Start the virtual device. 

Step 3: Connect ADB to Genymotion

Once the virtual device is running, connect ADB to the Genymotion emulator.

1. Check Connected Devices

Open a terminal and run:

adb devices
 

You should see a list of devices including the Genymotion virtual device. It will appear with an IP address, such as:

List of devices attached: 

192.168.85.103:5555 device

2. Verify ADB Shell Access

To ensure ADB is properly connected, enter the device’s shell:

adb shell 

Step 4: Install an App on the Genymotion Virtual Device

Now that ADB is connected, you can install an APK file onto the Genymotion virtual device.

1. Get an APK File

Download an APK file to your Linux system. For example, you can download a test APK from:

  • APKMirror for popular apps.
  • A sample app you want to test.

Save the APK file in a convenient directory (e.g., /home/user/Downloads/app.apk).

2. Install the APK

Use ADB to install the APK:

adb install /path/to/app.apk  
 

Example:

adb install ~/Downloads/sample-app.apk

3. Verify Installation

Once installed, you can verify by opening the app on the Genymotion device or by listing installed packages:

adb shell pm list packages | grep <package-name> 

Replace <package-name> with part of the app's name. For example:

adb shell pm list packages | grep sample 

Step 5: Explore the App via ADB

After installing the app, you can perform additional tasks using ADB:

1. Access App Data

Pull files from the app’s directory for analysis:

adb pull  /data/data/<package-name>/ ~/Downloads/

2. View App Logs

Monitor app logs in real-time:

adb logcat | grep <package-name>

3. Uninstall the App

Remove the app from the device:

adb uninstall <package-name>

Example:

adb uninstall com.example.sampleapp
Troubleshooting

Issue 1: ADB Device Not Detected

  • Ensure the Genymotion device is running.
  • Restart the ADB server:
    adb kill-server adb start-server adb devices

Issue 2: APK Not Installing

  • Verify that the APK file is not corrupted.
  • Ensure the APK is compatible with the Android version of the Genymotion device. 

Conclusion

Installing ADB on Linux and using it with Genymotion provides a flexible and efficient 

environment for testing Android applications. With ADB, you can install apps, 

analyze logs, and explore app behavior, making it an essential tool for developers

and pentesters alike.


 

 

 

 

Comments

Popular posts from this blog

Some Dark web Links

How to join Cyber Cell or Cyber Crime Department in India || Exam or Direct or Skills???

ATM HACKING TOOL TRENDING ON DARK WEB