Automatic Script for Android Emulator

1. What's it?

It's too complicated and error-prone if we manually override the HTTP Proxy, Install, and Trust Proxyman Certificate from your Android Emulator.

Therefore, Proxyman (2.10.0+) provides a built-in script to automatically perform it in a second. You can access from Certificate Menu -> Install Certificate on Android -> Emulator...

Proxyman requires Automation Permission in order to execute the automation script by AppleScript. Please consider granting Proxyman app in System Preference -> Security & Privacy -> Privacy -> Automation -> Allow Proxyman app.

If you would like to execute the automation script manually, please check out the last section.

2. Benefit?

  • Automatically Override or Revert HTTP Proxy

  • Automatically Download, Install, and Trust Proxyman Certificate to the Android Emulator System.

  • Less error-prone and finish in one click

Automatically performs in one-click

3. Android Emulator Google APIs

  • Please make sure that Automatic Script only works with Android Emulator with Google APIs version, not Google Play Store version.

  • You can create new Android Emulators and select Google APIs in the System Image step.

Google APIs version is possible to root the device and use adb command to perform certain tasks.

4. How does it work?

Proxyman uses the Android Debug Bridge (adb) to perform tasks automatically.

If you haven't installed the adb command yet, please follow the guideline:

  1. Install homebrew

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
  2. Install the adb command

    brew cask install android-platform-tools

Read more at: https://stackoverflow.com/questions/31374085/installing-adb-on-macos

This installation step might take up to 10 minutes depending on your internet connection and the size of the homebrew repo. Please be patient when the adb command is installed successfully!

Please make sure you Revert Override when you close Proxyman. Otherwise, your Android Emulator could not access the Internet.

Make sure that you remove these configs in the Release build. If not, your HTTP/HTTPS requests can be intercepted and leak your sensitive data in the Production build.

5. Run the script manually

It's possible to execute the script manually in your Terminal app without granting the Automation Permission in Security & Privacy.

Script path: /Applications/Proxyman.app/Contents/Frameworks/ProxymanCore.framework/Resources/install_certificate_android_emulator.sh

5.1 Override HTTP Proxy and Install the Certificate

  1. Open Proxyman app

  2. Replace 192.168.0.1 with your current IP (You can find it under Certificate Menu -> Install Certificate on iOS -> Physical Device -> Copy the IP string)

  3. Execute the following script from your Terminal app

$ bash /Applications/Proxyman.app/Contents/Frameworks/ProxymanCore.framework/Resources/install_certificate_android_emulator.sh all 192.168.0.1 9090 ~/.proxyman/proxyman-ca.pem

5.2 Only Override HTTP Proxy

  1. Open Proxyman app

  2. Replace 192.168.0.1 with your current IP (You can find it under Certificate Menu -> Install Certificate on iOS -> Physical Device -> Copy the IP string)

  3. Execute the following script from your Terminal app

$ bash /Applications/Proxyman.app/Contents/Frameworks/ProxymanCore.framework/Resources/install_certificate_android_emulator.sh proxy 192.168.0.1 9090

5.3 Revert HTTP Proxy

  1. Open Proxyman app

  2. Execute the following script from your Terminal app

$ bash /Applications/Proxyman.app/Contents/Frameworks/ProxymanCore.framework/Resources/install_certificate_android_emulator.sh revertProxy