Proxy Mail QA

Testing sign-up emails in an iOS app (SwiftUI or UIKit)

The iOS simulator has no Mail app, so the code or link your app emails has to be read somewhere else and brought back into the app. Here's how to do that by hand, in XCUITest, and with a coding agent, plus the link bugs worth checking while you're there.

Updated

Why sign-up emails are awkward to test on iOS

Test it by hand in the simulator

  1. Create an address in Proxy Mail QA. Turn on a persona and a generated password if your sign-up form asks for a name or a strong password.
  2. Sign up in the simulator with it. The simulator shares your Mac’s clipboard, so copy the address on the Mac and paste it into the app.
  3. Get the code. It appears on the address’s row with a Copy button within seconds of arriving. Paste it into the app.
  4. Or open the link in the app. Copy the link and run xcrun simctl openurl booted '<link>' in Terminal. For a myapp:// link the inbox shows that command next to the link, ready to copy. iOS asks “Open in ‘YourApp’?” the first time a custom scheme opens.

Automate it with XCUITest

Add the small Swift helper from the XCUITest guide to your UI test target, set PROXYMAIL_QA_API_KEY in the scheme or test plan, and the test reads the code itself:

Swift
let qa = try ProxyMailQA()
let account = try await qa.createAddress()
let app = XCUIApplication()
app.launch()

app.textFields["Email"].tap()
app.textFields["Email"].typeText(account.address)
let submitted = Date()
app.buttons["Create account"].tap()

let code = try await qa.waitForCode(account.address, since: submitted)
app.textFields["Code"].typeText(code)

For a link, app.open(try await qa.waitForLink(account.address, since: submitted)) opens it the way tapping it in an email would, without the “Open in” prompt. If the email has both a web link and a myapp:// one, pass app: true to get the app’s.

The same helper checks the email itself (checkEmail with your Universal Link domain, and countEmails for duplicates), signs in as a saved test account, and adds each test to the pull request’s report: see the XCUITest guide.

Or let a coding agent do it

Claude Code, Codex and Cursor can drive the simulator, create the address, type it in and read the code over Proxy Mail QA’s MCP server. See iOS apps with a coding agent.

What to check in SwiftUI and UIKit

Using Firebase email-link sign-in? It has its own setup on iOS: see Firebase email-link sign-in on mobile.

Try it on your next sign-up test

Free plan, no credit card. Create an address and watch the code or link arrive.

Create a free accountOpen the app

Questions

Can I read email in the iOS simulator?

Not with Mail: the simulator doesn't include it. Read the email in Proxy Mail QA instead, on your Mac, and paste the code into the simulator (it shares your Mac's clipboard) or open the link with xcrun simctl openurl booted followed by the link.

Why does my Universal Link open Safari instead of my app?

iOS opens the app only when its Associated Domains entitlement lists the link's domain and that domain serves an apple-app-site-association file naming the app. iOS reads the file through Apple's CDN when the app is installed, so after fixing it, delete and reinstall the app. For a staging domain the CDN can't reach, add ?mode=developer to the entry while you develop.

Does the API key go in my app?

No. The helper and the key belong to the UI test target only, with the key passed in from the test run (the scheme, the test plan or CI secrets). Nothing about Proxy Mail QA ships in your app.

Can I test codes sent by text message?

No. Proxy Mail QA receives email only. Codes sent by SMS need a different tool.

See every email testing problem we solve