アプリが閉じた状態でのUniversal Links経由の起動を繰り返しデバッグしたい時のメモ
手順
EditScheme
→Wait for executable to be launched
をチェック
これによって、Runした時にアプリが自動で起動しなくなりますアプリをRun(
Wait for executable to be launched
)Terminalで以下のコマンドを実行
$ xcrun simctl terminate booted <bundle_identifier> && xcrun simctl openurl booted <url>
これによって常にアプリが閉じた状態で、Universal Links経由でアプリが起動するようになります。
繰り替えし確認したい場合は2と3を繰り返すことで可能となります。
解説
細かいコマンドの仕様はhelpやdocumentを参照してください。
- xcrun simctl terminate booted <bundle_identifier>
は対象のアプリをタスクキルするのと同様です
- xcrun simctl openurl booted url
はUniversal Links経由でアプリを起動します