# Extracting an APK specimen from the device

This method ensures you are getting the same version of the APK as what your target device has on it. It could be particularly useful if dealing with an APK that isn't available on the Google Play store (or websites like APKPure or APK4Fun). A good example would be a corporate app that has been sideloaded.

A video containing the same steps as below has been created:

{% embed url="<https://youtu.be/_NIc-8Loerk>" %}

Before you begin, it is helpful to establish the application identifier, for instance `com.enchantedcloud.photovault`

Continuing with the photovault example:

1. Open an adb shell (as root if possible).<br>

2. Navigate to the app's installation directory by typing `cd /data/app/` and then `ls`

3. Confirm the folder exists beginning with *com.enchantedcloud*, then access the folder by typing `cd com.ench` and pressing \[TAB].<br>

4. In this directory you will find a file base.apk. We want to retrieve this off the emulator. You can either copy it's full path, or make your life easier by first copying the apk to an easier path. (e.g. copy the APK to /data/local/tmp by typing `cp base.apk /data/local/tmp`) <br>

5. Open another command window in your working directory. Finally, pull the APK to the host system with: `adb pull /data/local/tmp/base.apk`


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://summit-labs.frida.ninja/other-processes/extracting-apk-specimen-from-the-device.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
