1

iOS 14.2 Simulator missing link bubble

Context: I have used iMessage in my Xcode UI tests to simulate launching a deep link into my app. The test types out a message with a link in it, then taps on the metadata bubble to launch the link.

As you can see from the attached image, as of iOS 14 the simulator is not displaying the bubble during these tests. This means I have no way to simulate a link tap. For whatever reason, launching the simulator myself and typing in the link does produce the bubble.

Has anyone else had this issue, or found a resolution? Thanks.

Henry
  • 291
  • 2
  • 7
  • 14

2 Answers2

1

As a workaround and probably a better way, I would recommend you to open universal links with Safari. The core logic remains the same - first you enter the address, then you tap the "go" key

Roman Zakharov
  • 2,185
  • 8
  • 19
  • Thanks for the response -- At some point in the past when I used Safari it would not properly recognize the app scheme and just open the web destination instead (using Branch redirects, not technically iOS universal links). I'll try again and see how it goes. – Henry Dec 15 '20 at 18:11
  • Confirmed that this does not produce the same behavior -- it shows an alert "Safari cannot open the page because the address is invalid" – Henry Dec 15 '20 at 19:01
  • Ok, what happens if you use `xcrun simctl openurl` ? – Roman Zakharov Dec 16 '20 at 16:01
  • Everything works fine with that command -- but is there a way to run that from XCTest framework? – Henry Dec 16 '20 at 21:32
  • To fix _xcrun: error: unable to find utility "simctl"_ see https://stackoverflow.com/a/36726612/1505348 – Lucio Aug 24 '21 at 14:51
1

Based on previous comments I recommend you to use these utils to enable running shell commands on your test runner

https://github.com/Subito-it/SBTUITestTunnel

https://github.com/Subito-it/SBTUITestTunnelHost

It is a hacky way, but it is really helpful.

Then, use host.executeCommand("xcrun simctl openurl ...") to manipulate with simulators

Roman Zakharov
  • 2,185
  • 8
  • 19