Search code examples
iosxctesturl-schemeuitest

How do I unit or UI test a URL scheme on iOS


I gave my iOS app a URL scheme.

Is it possible to somehow test it either in a unit test or uitest?


Solution

  • So, Duncan is right. Manual test is possible. But I wasn't clear enough as I meant automatic tests. As Matt states it's not actually possible to test whether the app starts.

    But i managed to do automatic as follows:

    So I implemented a url scheme handler (service class), that I call right away, when the app is started from a url scheme.

    Then I can unit test this class, and that it takes the expected action upon different url schemes. (i.e. pushing certain view controllers etc.)

    I suppose this is sufficient to verify that my url schemes cause the expected actions.