如何从终端深层链接到 iOS 设备?

问题描述 投票:0回答:1

从终端机,我可以使用

深度链接到 Android 设备或模拟器

adb shell am start -a android.intent.action.VIEW -d "myurl"

对于 iOS,以下内容可以深度链接到模拟器

xcrun simctl openurl booted "myurl"

iOS设备连接终端怎么样?我搜索并找不到任何说明的地方。

android ios iphone
1个回答
0
投票

在玩了一下 devicectl 之后,我发现了一种几乎可以按需要工作的方法!

我发现可以在设备上启动一个带有 url 的应用程序,这给了我们两个选项:

  1. 使用适用的深度链接 URL 启动 safari。从那里检查深层链接选项是否可见:
    xcrun devicectl device process launch --device xxx --terminate-existing --payload-url https://example.com com.apple.mobilesafari
  2. 使用适用的深层链接 URL 启动您的应用程序。它应该像单击深层链接一样处理它:
    xcrun devicectl device process launch --device xxx --terminate-existing --payload-url https://example.com your.app.bundle.id
© www.soinside.com 2019 - 2024. All rights reserved.