UPDATE: Is this still possible with the new way of UI testing with Xcode?
Can I programmatically access my email from an iOS UI Automation script?
I want to access the signup code that my iPhone app emails to my email account.
Use NSURLSession
to make HTTP requests from within test methods. See: https://stackoverflow.com/a/35708282/242933