Android エミュレータ用の自動スクリプト
Proxyman の自動スクリプトで、Android エミュレータに HTTP プロキシを設定し、Proxyman 証明書をインストールします。ワンクリックで HTTPS 通信をキャプチャできます。
1. 概要
HTTP プロキシを手動で上書きし、Android エミュレータに Proxyman 証明書をインストールして信頼させる作業は、手順が複雑でミスも起こりやすいものです。
Proxyman には、この作業を数秒で行う組み込みスクリプトが用意されています。Certificate Menu → Install Certificate on Android → Emulators… から開けます。
Proxyman 5.16.0 以降では、Proxyman 証明書をシステムレベルのストアにインストールできます。これにより、Android エミュレータのすべての HTTPS 通信を復号できるようになります。
Proxyman は、Google Play エミュレータと Google Play 以外のエミュレータの両方に対応しています。ワンクリックで上書きできます。詳しくは google-play-android-emulator-with-magisk.md をご覧ください

動画
2. メリット
ワンクリックで次の操作ができます:
- ✅ 自動で HTTP プロキシの上書き / 元に戻す
- ✅ 自動で Proxyman 証明書をダウンロード、インストールし、システムレベルのストアで信頼させます。エミュレータのすべての HTTPS 通信を復号できます。(Proxyman 5.16.0 以降で利用可能)
- network_security_config.xml の設定は不要
- ✅ ミスが起こりにくく、数クリックで完了します
adb 経由で、Android エミュレータと Android の実機の両方に対応しています(Proxyman v5.19.0 以降のみ)

Proxyman で Android エミュレータの HTTPS をキャプチャして復号
- Proxyman 証明書をシステムレベルのストアにインストールします。
✅ Flutter / React Native アプリ
Proxyman macOS 6.4.0 以降では、コードを変更することなく Flutter アプリの HTTPS 通信をキャプチャできます。
詳しくは flutter.md のドキュメントをご覧ください。
3. 使い方
adbコマンドがインストールされていることを確認してください。インストールされていない場合は、インストールしてください。
brew install android-platform-tools
- Android Studio で Android アプリを開きます
- Android Virtual Device Manager で新しいエミュレータを作成します。Google Play イメージではないことを確認してください。必ず Google APIs イメージを選択してください。
- ✅ NEW: Proxyman で Google Play Store のエミュレータをルート化できるようになりました。詳しくは google-play-android-emulator-with-magisk.md をご覧ください
- Proxyman で Certificate Menu → Install Certificate on Android → Emulators… の順に開き、Override All Emulators ボタンをクリックします
- Terminal のスクリプトが完了するまで待ちます
- Android Studio から Android アプリを再起動します
- Proxyman がすべての HTTPS データをキャプチャします ✅
Proxyman を終了する場合は、必ず Revert All Changes ボタンをクリックしてください。そうしないと、Android エミュレータがインターネットに接続できなくなります。
4. ⚠️ Proxyman 5.15.0 以前
- Proxyman 5.15.0 以前では、Proxyman 証明書をユーザーレベルでしかインストールできません。
- そのため、次の手順を完了する必要があります:
- ソースコードで次の対応を行います:
- res/xml/network_security_config.xml を追加
<network-security-config>
<debug-overrides>
<trust-anchors>
<!-- Trust user added CAs while debuggable only -->
<certificates src="user" />
<certificates src="system" />
</trust-anchors>
</debug-overrides>
<base-config cleartextTrafficPermitted="true">
<trust-anchors>
<certificates src="system" />
<certificates src="user" />
</trust-anchors>
</base-config>
</network-security-config>
- AndroidManifest.xml に追加します
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:networkSecurityConfig="@xml/network_security_config">
<activity
...
</activity>
</application>
</manifest>
5. 上級:スクリプトを手動で実行
Privacy & Security(プライバシーとセキュリティ)で Automation の権限を許可しなくても、Terminal アプリで手動でスクリプトを実行できます。
スクリプトのパス:
/Applications/Proxyman.app/Contents/Frameworks/ProxymanCore.framework/Resources/install_certificate_android_emulator.sh
- Proxyman 5.19.0 以降の場合
Usage: /Applications/Proxyman.app/Contents/Frameworks/ProxymanCore.framework/Resources/install_certificate_android_emulator.sh -m <mode> [options]
Modes:
all Set proxy and install certificate
proxy Set proxy only
revertProxy Revert proxy settings only
certificate Install certificate only
Required Options based on Mode:
-m, --mode <mode> : Operation mode (all, proxy, revertProxy, certificate)
-i, --ip <ip_address> : IP address (required for all, proxy, certificate)
-p, --port <port_number> : Port number (required for all, proxy, certificate)
-c, --cert <path_to_cert.pem> : Path to Proxyman certificate (required for all, certificate)
Optional Options:
--include-physical : Include physical devices (default: only emulators)
-h, --help : Show this help message
証明書を準備する
- Proxyman アプリを開きます
- メインツールバーで現在の IP アドレスを確認します
- Certificate メニュー → Export → Root Certificate as PEM の順に選択し、デスクトップフォルダに保存します
5.1 HTTP プロキシを上書きし、証明書をシステムレベルのストアにインストール
- Proxyman v5.19.0 以降(新機能)
bash /Applications/Proxyman.app/Contents/Frameworks/ProxymanCore.framework/Resources/install_certificate_android_emulator.sh --mode all --ip <current_ip> --port <port> --cert <certificate_path>
- Proxyman v5.18.0 以前
bash /Applications/Proxyman.app/Contents/Frameworks/ProxymanCore.framework/Resources/install_certificate_android_emulator.sh all <current_ip> <port> <certificate_path>
5.2 HTTP プロキシのみを上書き
- Proxyman v5.19.0 以降(新機能)
bash /Applications/Proxyman.app/Contents/Frameworks/ProxymanCore.framework/Resources/install_certificate_android_emulator.sh --mode proxy --ip <current_ip> --port <port>
- Proxyman v5.18.0 以前
bash /Applications/Proxyman.app/Contents/Frameworks/ProxymanCore.framework/Resources/install_certificate_android_emulator.sh proxy <current_ip> <port>
5.3 HTTP プロキシを元に戻す
- Proxyman v5.19.0 以降(新機能)
bash /Applications/Proxyman.app/Contents/Frameworks/ProxymanCore.framework/Resources/install_certificate_android_emulator.sh --mode revertProxy
- Proxyman v5.18.0 以前
bash /Applications/Proxyman.app/Contents/Frameworks/ProxymanCore.framework/Resources/install_certificate_android_emulator.sh revertProxy
6. リーフ証明書の有効期限
6.1 問題:Android WebView で HTTPS をインターセプトすると、次のエラーが表示されます
❗️ Android WebView が ERR_CERT_VALIDITY_TOO_LONG で接続を拒否します
Proxyman の Settings → General を開き、証明書の横にある More → Leaf Certificate Expiry を選択して、10 日間などより短い有効期限を選んでください。
