Devices and runtimes
Android
Capture an Android emulator or USB device with one click through adb, install the Cloak Proxy certificate, and let your app trust user certificates.
Cloak Proxy can set up an Android emulator or a USB-connected Android device for you through adb, the Android Debug Bridge. It forwards the device’s proxy port to your Mac, sets the device’s proxy, and copies the certificate to it. Because Android apps ignore user-installed certificates by default, your app also needs a small network security config in its debug build.
The Android tab when adb is installed.
- Forwards the port and sets the device's proxy
- Removes the proxy and the port forward
- Copies the certificate to the device's Downloads folder
- Lists the devices adb can see
- Network security config for your app's debug build
Install adb
Section titled “Install adb”The one-click buttons need adb. Cloak Proxy looks for it in these places, in order:
| Location | Installed by |
|---|---|
/opt/homebrew/bin/adb |
Homebrew on Apple silicon |
/usr/local/bin/adb |
Homebrew on Intel, or a manual install |
/usr/bin/adb |
A manual install |
~/Library/Android/sdk/platform-tools/adb |
Android Studio’s SDK Manager |
If it finds none, the Android tab shows adb wasn’t found. Install Android platform tools (brew install android-platform-tools) for one-click setup. in place of the buttons.
brew install android-platform-toolsAfter installing, switch to another tab and back, or reopen the window, so Cloak Proxy finds adb.
Connect an emulator or USB device
Section titled “Connect an emulator or USB device”The Emulator or USB-connected device (adb) section uses adb reverse, so the device reaches Cloak Proxy over USB or the emulator bridge. You don’t need to change Wi-Fi settings on the device or let other devices connect to the Mac.
-
Start the emulator, or connect the device with a USB cable and turn on USB debugging in its Developer options. Accept the prompt on the device to allow your Mac.
-
Open Device & Runtime Setup (click Devices in the toolbar) and choose the Android tab.
-
Click Show Connected Devices to confirm
adbsees exactly one device. -
Click Connect Proxy.
The output area shows Proxy set to 127.0.0.1:9090 on the device. If either command fails, it shows
adb’s error instead. -
Click Push Certificate, then install it on the device. See Install the certificate.
What each button does
Section titled “What each button does”The buttons use the port Cloak Proxy is listening on (9090 by default).
| Button | Commands it runs | Result message |
|---|---|---|
| Connect Proxy | adb reverse tcp:9090 tcp:9090, then adb shell settings put global http_proxy 127.0.0.1:9090 |
Proxy set to 127.0.0.1:9090 on the device. |
| Disconnect Proxy | adb shell settings put global http_proxy :0, then adb reverse --remove tcp:9090 |
Proxy removed from the device. |
| Push Certificate | adb push <certificate> /sdcard/Download/cloak-proxy-ca.crt |
Copied to Downloads. On the device: Settings → Security → Encryption & credentials → Install a certificate → CA certificate. |
| Show Connected Devices | adb devices -l |
The list of devices, with their model names. |
adb reverse makes port 9090 on the device lead to port 9090 on your Mac, so the device’s proxy can be 127.0.0.1:9090. The global http_proxy setting is Android’s device-wide proxy, which apps that use the system proxy follow for both HTTP and HTTPS.
Install the certificate
Section titled “Install the certificate”Push Certificate copies the Cloak Proxy root certificate to the device’s Download folder as cloak-proxy-ca.crt. Android then needs you to install it.
-
On the device, open Settings › Security › Encryption & credentials. On some devices it’s under Settings › Security & privacy › More security settings or a similar path; search Settings for “certificate” if you can’t find it.
-
Tap Install a certificate, then CA certificate.
-
Android warns that a CA lets others see your data. Tap Install anyway.
-
Choose
cloak-proxy-ca.crtfrom the Download folder and confirm with the screen lock if asked.
The certificate is now a user certificate. Android’s browser and apps that opt in trust it. Most apps don’t trust it yet: see the next section.
You can also get the certificate without adb: once the device’s proxy points at Cloak Proxy, open http://cloak.proxy in the device’s browser and tap Download certificate (DER, Android / Windows). See Other devices and access control.
Make your app trust user certificates
Section titled “Make your app trust user certificates”Apps targeting Android 7 (API level 24) or later ignore user-installed CAs unless their network security config allows it. The Your app must trust user certificates section gives you the config to add to debug builds.
-
Create
res/xml/network_security_config.xmlin your app module:res/xml/network_security_config.xml <!-- res/xml/network_security_config.xml --><network-security-config><debug-overrides><trust-anchors><certificates src="user" /></trust-anchors></debug-overrides></network-security-config> -
Reference it from the
<application>element inAndroidManifest.xml:AndroidManifest.xml <applicationandroid:networkSecurityConfig="@xml/network_security_config"...> -
Build and install a debug build, then use the app.
Everything inside <debug-overrides> applies only when the app is debuggable, so release builds keep trusting only the system CAs. You can’t add this to apps you don’t build, so most third-party apps on Android 7 and later can’t be decrypted.
Then add your API’s host to SSL Proxying so Cloak Proxy decrypts it.
Use Wi-Fi instead of adb
Section titled “Use Wi-Fi instead of adb”For a device you can’t connect over USB, use the Wi-Fi proxy, the same way as an iPhone.
-
In Cloak Proxy, turn on Allow other devices to connect (phones, other computers) in Settings › General and click Apply & Restart Proxy. The setting shows This Mac’s address, for example
192.168.1.20:9090. -
On the device, open the Wi-Fi network’s settings, find Proxy (often under Advanced options), and choose Manual.
-
Enter your Mac’s address as the proxy hostname and
9090as the port, then save. -
Open
http://cloak.proxyin the device’s browser, tap Download certificate (DER, Android / Windows), and install it as a CA certificate.
The exact Wi-Fi settings path differs between Android versions and manufacturers. Traffic from a Wi-Fi device appears in the sidebar under its IP address.
Undo the setup
Section titled “Undo the setup”-
Click Disconnect Proxy. It clears the device’s proxy and removes the port forward. Do this before you unplug the device or quit Cloak Proxy: a device whose proxy is
127.0.0.1:9090without the forward can’t reach the internet.Without Cloak Proxy, run the same commands yourself:
Terminal adb shell settings put global http_proxy :0adb reverse --remove tcp:9090 -
Remove the certificate on the device: open Settings › Security › Encryption & credentials › User credentials (or Trusted credentials › User), select the Cloak Proxy CA, and remove it. Delete
cloak-proxy-ca.crtfrom Download too. -
If you used Wi-Fi, set the network’s proxy back to None, and turn off Allow other devices to connect on the Mac.
If you regenerate the root certificate in Settings › Certificate, push and install the new one.