# Proxy your Android emulator and iOS simulator to your local Docker stack

DevFeed: [Proxy your Android emulator and iOS simulator to your local Docker stack](<https://devfeed.tech/articles/proxy-your-android-emulator-and-ios-simulator-to-your-local-docker-stack-62717.md>)

Original publisher: [Read original article](<https://proandroiddev.com/proxy-your-android-emulator-and-ios-simulator-to-your-local-docker-stack-d251321d8017?source=rss----c72404660798---4>)

Author: Jan Rabe

Published: 2026-09-30T15:10:37Z

Content type: article

Language: en

Sources: [ProAndroidDev](<https://devfeed.tech/sources/proandroiddev-medium.md>)

Topics: [Android](<https://devfeed.tech/topics/android.md>), [Domain Name System (DNS)](<https://devfeed.tech/topics/dns-resolution-process.md>), [trust](<https://devfeed.tech/topics/trust.md>), [adb](<https://devfeed.tech/topics/adb.md>), [Docker Compose](<https://devfeed.tech/topics/docker-compose.md>), [iOS](<https://devfeed.tech/topics/ios.md>), [traefik](<https://devfeed.tech/topics/traefik.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [compose](<https://devfeed.tech/tags/compose.md>), [debugging](<https://devfeed.tech/tags/debugging.md>), [dns](<https://devfeed.tech/tags/dns.md>), [docker](<https://devfeed.tech/tags/docker.md>), [domain](<https://devfeed.tech/tags/domain.md>), [emulator](<https://devfeed.tech/tags/emulator.md>), [https](<https://devfeed.tech/tags/https.md>), [image](<https://devfeed.tech/tags/image.md>), [ios](<https://devfeed.tech/tags/ios.md>), [ios-simulator](<https://devfeed.tech/tags/ios-simulator.md>), [lab](<https://devfeed.tech/tags/lab.md>), [local](<https://devfeed.tech/tags/local.md>), [lookup](<https://devfeed.tech/tags/lookup.md>), [mac](<https://devfeed.tech/tags/mac.md>), [means](<https://devfeed.tech/tags/means.md>), [mobile-app-development](<https://devfeed.tech/tags/mobile-app-development.md>), [proxy](<https://devfeed.tech/tags/proxy.md>), [reverse-proxy](<https://devfeed.tech/tags/reverse-proxy.md>), [routing](<https://devfeed.tech/tags/routing.md>), [single-source-of-truth](<https://devfeed.tech/tags/single-source-of-truth.md>), [stack](<https://devfeed.tech/tags/stack.md>)

## AI overview

An HTTPS proxy on the Mac lets an Android emulator reach a local Docker stack using the same hostnames as production: the proxy resolves names through the Mac's /etc/hosts and forwards requests with the hostname intact. The approach requires trusting the proxy's CA; Android apps targeting API 24+ need a debug-only network security config opting into user certificates, and the Android setup requires a rooted Google APIs emulator image. The described script automates setup and cleanup. iOS simulators share the Mac's network, so they need proxy configuration and a certificate profile rather than Android's routing and root steps. Limits include device-wide proxy settings, clients that ignore system proxies, certificate pinning, and physical devices being out of scope.

## Source excerpt

One command handles the certificate and the routing. The interesting part is why it takes fourteen steps by hand. TL;DR: Point the device at an HTTPS proxy running on your Mac. The proxy does the DNS lookup, so your Mac's /etc/hosts becomes the single source of truth for routing. The device only needs to trust one certificate, once. If you want to skip ahead: uvx proxy-lab start android. GitHub - kibotu/proxy-lab.sh: Android's two HTTPS blockers - device trust and proxy routing - scripted end to end, with pre-flight checks that catch the usual traps first. Pinned, CI-tested, one YAML for both platforms. Image generated by Gemini.The setup you already have Docker Compose on your Mac. A reverse proxy (Traefik, nginx, Caddy, pick your favorite) listens on 443 and routes by hostname: mysub.domain.com -> api container auth.domain.com -> keycloak container Your /etc/hosts has the usual line: 127.0.0.1 mysub.domain.com auth.domain.com Safari opens https://mysub.domain.com and the whole stack works. Nice. So you build the debug app against the same URL, hit run, and get this: java.net.UnknownHostException: Unable to resolve host "mysub.domain.com" Or something more exciting: it resolves, because the domain is real and public, and your integration test just wrote a row into production. Both are fixable with one idea. The rest of this article is why that idea needs a certificate. The emulator is a different computer That is the whole thing in one sentence. The Android emulator runs its own kernel with its own network stack and its own resolver, and it has never heard of your /etc/hosts. Neither has the iOS simulator, though for a nicer reason we will get to. The first instinct is to give the device the same hosts file. On Android that means /system/etc/hosts, a writable system image, and -writable-system on every boot. It works, and you can feel the shape of the problem: the same mapping now lives in two places, and the second one resets itself at the worst time. The second i