> For the complete documentation index, see [llms.txt](https://sec88.0x88.online/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sec88.0x88.online/android-appsec/setup-android-app-pentesting-environment-on-mac-m4.md).

# Setup Android App Pentesting environment on Mac M4

{% embed url="<https://hassan14045.medium.com/setup-android-app-pen-testing-environment-on-mac-book-m1-d3843e23534>" %}

{% embed url="<https://www.linkedin.com/pulse/setting-up-android-app-pen-testing-environment-xbxvf>" %}

{% embed url="<https://m4g0.com/posts/how-to-set-up-a-mobile-pen-testing-environment/>" %}

### Install Java

```bash
brew install openjdk
brew install --cask temurin
```

### Install Android Command line tools

{% embed url="<https://developer.android.com/studio#downloads>" %}

<figure><img src="/files/x3vmSW88ogGXPS2bXON0" alt=""><figcaption></figcaption></figure>

```bash
or 
brew install android-commandlinetools
mkdir /Library/Android
mkdir /Liberary/Android/sdk
mv cmdline-tools /Liberary/Android/sdk/
cd /Library/Android/sdk/cmdline-tools
mkdir latest
mv * latest/
echo 'export ANDROID_SDK_ROOT=/Library/Android/sdk' >> ~/.zprofile
echo 'export PATH=$ANDROID_SDK_ROOT/cmdline-tools/latest/bin:$ANDROID_SDK_ROOT/platform-tools:$PATH' >> ~/.zprofile
source ~/.zprofile
sdkmanager --list
```

### Install Emulator

{% code overflow="wrap" %}

```bash
sdkmanager --install "platform-tools" "emulator"
```

{% endcode %}

### Install apksigner

```bash
sdkmanager --channel=0 --install "build-tools;31.0.0” 
echo 'export PATH=$ANDROID_SDK_ROOT//build-tools/31.0.0/lib' >> ~/.zprofile
source ~/.zprofile
```

### Create and Run an Emulator

{% code overflow="wrap" %}

```bash
sdkmanager --install "system-images;android-26;google_apis;arm64-v8a"                               echo 'export PATH=$PATH:/Library/Android/sdk/emulator' >> ~/.zprofile
source ~/.zprofile
```

{% endcode %}

### Create Android Virtual Device

{% code overflow="wrap" %}

```bash
avdmanager create avd -n my_emulator_arm -k "system-images;android-26;google_apis;arm64-v8a" --force
```

{% endcode %}

### Run the AVD

```bash
emulator -avd my_emulator_arm
```

### Install apktool

```bash
brew install apktool
```

### Install Frida

```bash
pipx install frida-tools
pip3 install frida==17.9.1 frida-tools objection --break-system-packages
# make sure that your emulator virtual device is arm 
adb shell getprop ro.product.cpu.abi
arm64-v8a
# install frida server frida-server-16.6.6-android-arm64.xz
https://github.com/frida/frida/releases
unxz frida-server-16.6.6-android-arm64.xz
adb push frida-server-16.6.6-android-arm64 /data/local/tmp/
adb shell mv /data/local/tmp/frida-server-16.6.6-android-arm64  /data/local/tmp/frida-server
adb shell chmod +x /data/local/tmp/frida-server
adb shell /data/local/tmp/frida-server &
```

### Install APK Signer

{% embed url="<https://github.com/patrickfav/uber-apk-signer/releases>" %}

### Install dex2jar

```bash
brew install dex2jar
```

### Install Drozer

```bash
pipx install drozer 
# https://github.com/WithSecureLabs/drozer-agent/releases/tag/3.1.0
adb install drozer-agent.apk
adb forward tcp:31415 tcp:31415
drozer console connect
```

### Install Jadx

```bash
brew install jadx
```

### Install Magisk

{% embed url="<https://github.com/topjohnwu/Magisk/releases/tag/v28.1>" %}

### Rooting Android Studio Emulator

{% embed url="<https://github.com/newbit1/rootAVD>" %}

{% embed url="<https://www.youtube.com/watch?v=vO92Gs9kyfg>" %}

### Magisk Frida

{% embed url="<https://github.com/ViRb3/magisk-frida>" %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://sec88.0x88.online/android-appsec/setup-android-app-pentesting-environment-on-mac-m4.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.
