From dc584aa31002fde605fced1842317b87d7303891 Mon Sep 17 00:00:00 2001 From: Daniel Hu Date: Tue, 25 Jun 2024 23:43:40 +0900 Subject: [PATCH 1/2] =?UTF-8?q?feat=EF=BC=9A=E5=AE=8C=E6=88=9069=20md=20&?= =?UTF-8?q?=20yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ng-your-app-in-simulator-or-on-a-device.md | 90 +++++++++++++++++++ ...g-your-app-in-simulator-or-on-a-device.yml | 90 +++++++++---------- 2 files changed, 135 insertions(+), 45 deletions(-) create mode 100644 project/visionos/Markdown/running-your-app-in-simulator-or-on-a-device.md diff --git a/project/visionos/Markdown/running-your-app-in-simulator-or-on-a-device.md b/project/visionos/Markdown/running-your-app-in-simulator-or-on-a-device.md new file mode 100644 index 0000000..11cef46 --- /dev/null +++ b/project/visionos/Markdown/running-your-app-in-simulator-or-on-a-device.md @@ -0,0 +1,90 @@ +# 在模拟器或设备上运行应用 + +在模拟的 iOS、tvOS、watchOS 或 visionOS 设备上,或在与 Mac 相连的设备上启动应用。 + +## 概述 + +要测试应用,请在模拟或真实设备上构建并运行应用。使用模拟设备在你无法直接访问的各种硬件上调试应用。但由于模拟设备在 Mac 上的模拟器应用中运行,所以无法复制实际设备的性能或功能。要验证你的应用是否按预期运行,请在一台或多台真实设备上运行。你可以使用连接线线将真实设备连接到 Mac,而对于 iOS、tvOS 或 visionOS 应用,可在将设备与 Xcode 配对后通过 Wi-Fi 进行连接。 + +通过 SwiftUI 预览,你可以在不构建和运行应用的情况下查看应用的界面。有关这些动态预览的更多信息,请参阅 [在 Xcode 中预览](https://developer.apple.com/documentation/SwiftUI/Previews-in-Xcode)。 + +### 选择构建方案和运行目标 + +在构建和运行应用之前,请选择包含应用目标的构建方案。*构建方案*是项目详细信息和设置的集合,用于告诉 Xcode 如何从你的项目构建和运行产品。Xcode 会根据你选择的方案确定生成的产品可以在何处运行,并在工具栏的运行目标菜单中填充可用设备列表。例如,如果方案仅包含一个 tvOS 应用,则Xcode 将只把 tvOS 模拟器和设备作为潜在的运行目标。 + +想了解有关构建方案的更多信息,请参阅[自定义项目的构建方案](https://developer.apple.com/documentation/xcode/customizing-the-build-schemes-for-a-project)。 + +> 重要 +> 在模拟器中运行应用时,某些限定硬件的功能可能不可用。提供设备特定功能访问权限的框架也会提供 API来告知你这些功能何时可用。请调用这些 API 并处理功能不可用的情况。要测试功能本身,请在真实设备上运行代码。 + +### 配置模拟设备列表 + +在 Xcode 的“设备和模拟器(Devices and Simulators)”窗口中管理真实和模拟设备。要查看此窗口,请选择窗口(Window) > 设备和模拟器(Devices and Simulators)。在“模拟器”选项卡中查看和配置模拟设备。 + + + +要添加新的模拟设备,请单击模拟器列表底部的加号 (+) 按钮,然后指定所需的配置。你可以添加新的模拟器并指定与默认设置不同的设备类型或操作系统版本。要从列表中删除模拟器,请选择该模拟器并按 Delete 键。 + +> 注意 +> Xcode 需要构建和运行模拟器的每个平台和系统版本的模拟器运行时。如果 Xcode 不显示某个平台的设备类型,则可能需要安装该平台的模拟器运行时。有关安装的更多信息,请参阅[安装和管理模拟器运行时](https://developer.apple.com/documentation/xcode/installing-additional-simulator-runtimes)。 + +### 将真实设备连接到 Mac + +要查看和管理与真实设备的连接,请在 Xcode 的“设备和模拟器”窗口中选择“设备(Devices)”选项卡。“设备”选项卡显示当前已连接和断开连接的设备,可帮助你诊断可能出现的问题。例如,如果某个设备运行的操作系统版本不支持你的应用,Xcode 可能会将其显示为不可用。它还会显示可与 Xcode 配对的新设备。将设备与 Xcode 配对,以便将其包含在项目的运行目标列表中。 + +要通过物理连接配对设备,请使用适当的连接线将设备连接到 Mac。解锁设备,并按照 Xcode 或设备上出现的任何指示操作。 + +要在没有物理连接的情况下配对 Apple Vision Pro 或 Apple TV: + +1. 确保 Mac 和要连接的设备位于同一个 Wi-Fi 网络中。Wi-Fi 网络必须与 Bonjour 兼容。 + +2. 通过本地网络将设备广播至目标 Mac。对于 visionOS 设备,请选择“设置(Settings)” > “常规(General)” > “远程设备(Remote Devices)”;对于 tvOS 设备,请选择“设置(Settings)” > “远程控制和设备(Remote and Devices)” > “远程应用和设备(Remote App and Devices)”。 + +3. 从 Xcode 的“设备和模拟器(Devices and Simulators)”窗口列表中选择设备,然后点击配对按钮,目标设备上会出现一个代码。 + +4. 在 Mac 上输入代码,完成配对过程。 + +配对完成后,设备将显示在 Xcode 中“设备和模拟器”窗口的已连接设备下。在安装和运行应用时,无需将配对设备与 Mac 保持物理连接。如果你的设备连接到与 Mac 处于同一网络的 Wi-Fi,Xcode 就可以使用该链接来安装和运行你的应用。 + +要将 Apple Watch 与 Mac 配对,请使用数据线将其配套的 iPhone 与 Mac 连接,并确保 iPhone 已配对以进行开发。完成此步骤后,请按照 Apple Watch 上的指示信任 Mac。当通过运行 iOS 17 或更高版本的 iPhone 配对时,Xcode 会通过 Wi-Fi 连接到 Apple Watch。5 系列和更旧型号的 Apple Watch 还要求 Apple Watch 和 Mac 与同一个兼容 Bonjour 的 Wi-Fi 网络相关联。当通过运行旧版 iOS 的 iPhone 配对时,Xcode 要求 iPhone 与 Mac 保持连接,以便在任何型号的 Apple Watch 上进行开发。 + +在安装应用之前,请执行几个额外的步骤: + +- 在 Xcode 的“帐户(Account)”偏好选项中指定你的 Apple ID。 +- 在项目的“签名和功能(Signing & Capabilities)”窗格中指定一个有效的团队。 +- 如果 macOS 应用包含需要代码签名的功能,请对其进行代码签名;请参阅[向应用添加功能](https://developer.apple.com/documentation/xcode/adding-capabilities-to-your-app)。 +- 如果你属于 [Apple Developer Program](https://developer.apple.com/programs/),请向你的团队注册设备。 +- 按照[在设备上启用开发者模式](https://developer.apple.com/documentation/xcode/enabling-developer-mode-on-a-device)中的描述,在 iOS、watchOS 或 visionOS 设备上启用开发者模式。 + +> 注意 +> 运行 macOS 应用无需配置 Mac 设备。同样,要运行 MacOS 版本的 iPad 应用,请选择“我的 Mac”(正在运行 Xcode 的 Mac)作为设备。 + +### 运行应用 + +单击工具栏中的运行按钮或选择“产品(Product)” > “运行(Run)”,在选定的模拟或真实设备上构建并运行应用。在工具栏的活动区域查看构建状态。 + +如果构建成功,Xcode 会运行应用并在调试区域打开调试会话。使用调试区域中的控件逐步查看代码、检查变量并与调试器交互。 + +如果构建不成功,请单击活动区域中的指示器以阅读“问题”导航器中的错误或警告信息。或者选择“视图(View)” > “导航器(Navigators)” > “显示问题导航器(Show Issue Navigator)”查看信息。 + +完成应用测试后,单击工具栏中的“停止”按钮。 + +### 与模拟环境交互 + +如果选择模拟设备作为运行目标,模拟器会启动并显示一个与模拟环境相对应的窗口。对于某些设备,模拟器会用一个与目标设备相似的外壳环绕屏幕内容。在 visionOS 中,模拟器会显示一个合成空间,以模拟佩戴设备时的体验。 + +每个设备外壳和空间都有特定的控件来支持交互。有关特定设备的详细信息,请参阅有关交互参考资料。 + +- [在 iOS 和 iPadOS 模拟器中与应用交互](https://developer.apple.com/documentation/xcode/interacting-with-your-app-in-the-ios-or-ipados-simulator) +- [在 tvOS 模拟器中与应用交互](https://developer.apple.com/documentation/xcode/interacting-with-your-app-in-the-tvos-simulator) +- [在 watchOS 模拟器中与应用交互](https://developer.apple.com/documentation/xcode/interacting-with-your-app-in-the-watchos-simulator) +- [在 visionOS 模拟器中与应用交互](https://developer.apple.com/documentation/xcode/interacting-with-your-app-in-the-visionos-simulator) + +--- + +## 另见 + +### 精要 + +- [在设备上启用开发者模式](https://developer.apple.com/documentation/xcode/enabling-developer-mode-on-a-device) +授予或拒绝本地安装的应用在 iOS、iPadOS、visionOS 和 watchOS 设备上运行的权限。 \ No newline at end of file diff --git a/project/visionos/running-your-app-in-simulator-or-on-a-device.yml b/project/visionos/running-your-app-in-simulator-or-on-a-device.yml index e4d4b9e..99fc36a 100644 --- a/project/visionos/running-your-app-in-simulator-or-on-a-device.yml +++ b/project/visionos/running-your-app-in-simulator-or-on-a-device.yml @@ -1,135 +1,135 @@ - 内容: 'Running your app in Simulator or on a device' 提示: '' - 翻译: '' + 翻译: '在模拟器或设备上运行应用' - 内容: 'Launch your app in a simulated iOS, tvOS, watchOS, or visionOS device, or on a device connected to a Mac.' 提示: '' - 翻译: '' + 翻译: '在模拟的 iOS、tvOS、watchOS 或 visionOS 设备上,或在与 Mac 相连的设备上启动应用。' - 内容: 'Overview' 提示: '' - 翻译: '' + 翻译: '概述' - 内容: 'To test your app, build and run it on a simulated or real device. Use simulated devices to debug your app on a variety of hardware to which you don’t have immediate access. The tradeoff is that simulated devices run within the Simulator app on your Mac and don’t replicate the performance or features of an actual device. To verify your app runs exactly as intended, run it on one or more real devices. You can connect a real device to your Mac using a cable, or for iOS, tvOS, or visionOS apps, connect it over Wi-Fi after you pair it with Xcode.' 提示: '' - 翻译: '' + 翻译: '要测试应用,请在模拟或真实设备上构建并运行应用。使用模拟设备在你无法直接访问的各种硬件上调试应用。但由于模拟设备在 Mac 上的模拟器应用中运行,所以无法复制实际设备的性能或功能。要验证你的应用是否按预期运行,请在一台或多台真实设备上运行。你可以使用连接线线将真实设备连接到 Mac,而对于 iOS、tvOS 或 visionOS 应用,可在将设备与 Xcode 配对后通过 Wi-Fi 进行连接。' - 内容: 'SwiftUI previews let you see your app’s interface without building and running your app. For more information on these dynamic previews, see Previews in Xcode.' 提示: '' - 翻译: '' + 翻译: '通过 SwiftUI 预览,你可以在不构建和运行应用的情况下查看应用的界面。有关这些动态预览的更多信息,请参阅 在 Xcode 中预览。' - 内容: 'Select a build scheme and run destination' 提示: '' - 翻译: '' + 翻译: '选择构建方案和运行目标' - 内容: 'Before you build and run your app, select a build scheme that includes the target for your app. A scheme is a collection of project details and settings that tell Xcode how to build and run a product from your project. Xcode determines where the resulting product can run based on the scheme you select, and populates the run destination menu in the toolbar with the list of available devices. For example, if the scheme contains a tvOS app, Xcode includes only tvOS simulators and devices as potential run destinations.' 提示: '' - 翻译: '' + 翻译: '在构建和运行应用之前,请选择包含应用目标的构建方案。构建方案是项目详细信息和设置的集合,用于告诉 Xcode 如何从你的项目构建和运行产品。Xcode 会根据你选择的方案确定生成的产品可以在何处运行,并在工具栏的运行目标菜单中填充可用设备列表。例如,如果方案仅包含一个 tvOS 应用,则Xcode 将只把 tvOS 模拟器和设备作为潜在的运行目标。' - 内容: 'To learn more about schemes, see Customizing the build schemes for a project.' 提示: '' - 翻译: '' + 翻译: '想了解有关构建方案的更多信息,请参阅自定义项目的构建方案。' - 内容: 'Important' 提示: '' - 翻译: '' + 翻译: '重要' - 内容: 'When running apps in Simulator, some hardware-specific features might not be available. Frameworks that provide access to device-specific features also provide API to tell you when those features are available. Call those APIs and handle the case where a feature isn’t available. To test the feature itself, run your code on a real device.' 提示: '' - 翻译: '' + 翻译: '在模拟器中运行应用时,某些限定硬件的功能可能不可用。提供设备特定功能访问权限的框架也会提供 API来告知你这些功能何时可用。请调用这些 API 并处理功能不可用的情况。要测试功能本身,请在真实设备上运行代码。' - 内容: 'Configure the list of simulated devices' 提示: '' - 翻译: '' + 翻译: '配置模拟设备列表' - 内容: 'Manage real and simulated devices in the Devices and Simulators window in Xcode. To view this window, choose Window > Devices and Simulators. View and configure simulated devices from the Simulators tab.' 提示: '' - 翻译: '' + 翻译: '在 Xcode 的“设备和模拟器(Devices and Simulators)”窗口中管理真实和模拟设备。要查看此窗口,请选择窗口(Window) > 设备和模拟器(Devices and Simulators)。在“模拟器”选项卡中查看和配置模拟设备。' - 内容: 'To add a new simulated device, click the plus (+) button at the bottom of the list of simulators and specify the configuration you want. You can add new simulators to specify a different device type or operating system version than the default set. To remove a simulator from the list, select it and press Delete.' 提示: '' - 翻译: '' + 翻译: '要添加新的模拟设备,请单击模拟器列表底部的加号 (+) 按钮,然后指定所需的配置。你可以添加新的模拟器并指定与默认设置不同的设备类型或操作系统版本。要从列表中删除模拟器,请选择该模拟器并按 Delete 键。' - 内容: 'Note' 提示: '' - 翻译: '' + 翻译: '注意' - 内容: 'Xcode requires the Simulator runtime for each platform and system version for which you build and run Simulator. If Xcode doesn’t display device types for a platform, you might need to install that platform’s Simulator runtime. For more information on this installation, see Installing and managing Simulator runtimes.' 提示: '' - 翻译: '' + 翻译: 'Xcode 需要构建和运行模拟器的每个平台和系统版本的模拟器运行时。如果 Xcode 不显示某个平台的设备类型,则可能需要安装该平台的模拟器运行时。有关安装的更多信息,请参阅安装和管理模拟器运行时。' - 内容: 'Connect real devices to your Mac' 提示: '' - 翻译: '' + 翻译: '将真实设备连接到 Mac' - 内容: 'To view and manage connections to your real devices, choose the Devices tab in the Devices and Simulators window in Xcode. The Devices tab shows the currently connected and disconnected devices and can help you diagnose problems that might occur. For example, Xcode might show a device as unavailable if it’s not running an operating system version your app supports. It also shows new devices available for pairing with your Xcode installation. Pair a device with Xcode to include them in the list of run destinations for your projects.' 提示: '' - 翻译: '' + 翻译: '要查看和管理与真实设备的连接,请在 Xcode 的“设备和模拟器”窗口中选择“设备(Devices)”选项卡。“设备”选项卡显示当前已连接和断开连接的设备,可帮助你诊断可能出现的问题。例如,如果某个设备运行的操作系统版本不支持你的应用,Xcode 可能会将其显示为不可用。它还会显示可与 Xcode 配对的新设备。将设备与 Xcode 配对,以便将其包含在项目的运行目标列表中。' - 内容: 'To pair a device with a physical connection, connect the device to your Mac using an appropriate cable. Unlock the device and follow any instructions that appear in Xcode or on the device.' 提示: '' - 翻译: '' + 翻译: '要通过物理连接配对设备,请使用适当的连接线将设备连接到 Mac。解锁设备,并按照 Xcode 或设备上出现的任何指示操作。' - 内容: 'To pair Apple Vision Pro or Apple TV without a physical connection:' 提示: '' - 翻译: '' + 翻译: '要在没有物理连接的情况下配对 Apple Vision Pro 或 Apple TV:' - 内容: 'Ensure that both your Mac and the device to connect are on the same Wi-Fi network. The Wi-Fi network must be compatible with Bonjour.' 提示: '' - 翻译: '' + 翻译: '确保 Mac 和要连接的设备位于同一个 Wi-Fi 网络中。Wi-Fi 网络必须与 Bonjour 兼容。' - 内容: 'Broadcast the device to the target Mac over the local network. To do this for a visionOS device, choose Settings > General > Remote Devices and for a tvOS device, choose Settings > Remotes and Devices > Remote App and Devices.' 提示: '' - 翻译: '' + 翻译: '通过本地网络将设备广播至目标 Mac。对于 visionOS 设备,请选择“设置(Settings)” > “常规(General)” > “远程设备(Remote Devices)”;对于 tvOS 设备,请选择“设置(Settings)” > “远程控制和设备(Remote and Devices)” > “远程应用和设备(Remote App and Devices)”。' - 内容: 'Select the device from the list in the Devices and Simulators window in Xcode and click the pairing button which triggers a code to appear on the target device.' 提示: '' - 翻译: '' + 翻译: '从 Xcode 的“设备和模拟器(Devices and Simulators)”窗口列表中选择设备,然后点击配对按钮,目标设备上会出现一个代码。' - 内容: 'Enter the code on the Mac to complete the pairing process.' 提示: '' - 翻译: '' + 翻译: '在 Mac 上输入代码,完成配对过程。' - 内容: 'After pairing is complete, the device shows up under connected devices in Devices and Simulators window in Xcode. You don’t need to keep a paired device physically connected to your Mac to install and run apps. If your device is connected to Wi-Fi on the same network as your Mac, Xcode can use that connection to install and run your app.' 提示: '' - 翻译: '' + 翻译: '配对完成后,设备将显示在 Xcode 中“设备和模拟器”窗口的已连接设备下。在安装和运行应用时,无需将配对设备与 Mac 保持物理连接。如果你的设备连接到与 Mac 处于同一网络的 Wi-Fi,Xcode 就可以使用该链接来安装和运行你的应用。' - 内容: 'To pair an Apple Watch to a Mac, connect its companion iPhone to the Mac with a cable, and ensure that the iPhone is paired for development. After this step, follow any instructions on the Apple Watch to trust the Mac. When paired through an iPhone running iOS 17 or later, Xcode connects to the Apple Watch over Wi-Fi. Series 5 and older models of Apple Watch additionally require the Apple Watch and Mac to be associated with the same Bonjour-compatible Wi-Fi network. When paired through an iPhone running older versions of iOS, Xcode requires the iPhone to remain connected to the Mac in order to develop on any model of Apple Watch.' 提示: '' - 翻译: '' + 翻译: '要将 Apple Watch 与 Mac 配对,请使用数据线将其配套的 iPhone 与 Mac 连接,并确保 iPhone 已配对以进行开发。完成此步骤后,请按照 Apple Watch 上的指示信任 Mac。当通过运行 iOS 17 或更高版本的 iPhone 配对时,Xcode 会通过 Wi-Fi 连接到 Apple Watch。5 系列和更旧型号的 Apple Watch 还要求 Apple Watch 和 Mac 与同一个兼容 Bonjour 的 Wi-Fi 网络相关联。当通过运行旧版 iOS 的 iPhone 配对时,Xcode 要求 iPhone 与 Mac 保持连接,以便在任何型号的 Apple Watch 上进行开发。' - 内容: 'Before installing your app, perform a few additional steps:' 提示: '' - 翻译: '' + 翻译: '在安装应用之前,请执行几个额外的步骤:' - 内容: 'Specify your Apple ID in the Account preferences in Xcode.' 提示: '' - 翻译: '' + 翻译: '在 Xcode 的“帐户(Account)”偏好选项中指定你的 Apple ID。' - 内容: 'Specify a valid team in your project’s Signing & Capabilities pane.' 提示: '' - 翻译: '' + 翻译: '在项目的“签名和功能(Signing & Capabilities)”窗格中指定一个有效的团队。' - 内容: 'Code sign your macOS app if it includes capabilities that require code signing; see Adding capabilities to your app.' 提示: '' - 翻译: '' + 翻译: '如果 macOS 应用包含需要代码签名的功能,请对其进行代码签名;请参阅向应用添加功能。' - 内容: 'Register the device with your team if you belong to the Apple Developer Program.' 提示: '' - 翻译: '' + 翻译: '如果你属于 Apple Developer Program,请向你的团队注册设备。' - 内容: 'Enable Developer Mode on an iOS, watchOS, or visionOS device, as described in Enabling Developer Mode on a device.' 提示: '' - 翻译: '' + 翻译: '按照在设备上启用开发者模式中的描述,在 iOS、watchOS 或 visionOS 设备上启用开发者模式。' - 内容: 'Note' 提示: '' - 翻译: '' + 翻译: '注意' - 内容: 'You don’t need to configure a Mac device to run your macOS apps. Similarly, to run the macOS version of an iPad app, choose My Mac (the Mac running Xcode) as the device.' 提示: '' - 翻译: '' + 翻译: '运行 macOS 应用无需配置 Mac 设备。同样,要运行 MacOS 版本的 iPad 应用,请选择“我的 Mac”(正在运行 Xcode 的 Mac)作为设备。' - 内容: 'Run the app' 提示: '' - 翻译: '' + 翻译: '运行应用' - 内容: 'Click the Run button in the toolbar or choose Product > Run to build and run the app on the selected simulated or real device. View the status of the build in the activity area of the toolbar.' 提示: '' - 翻译: '' + 翻译: '单击工具栏中的运行按钮或选择“产品(Product)” > “运行(Run)”,在选定的模拟或真实设备上构建并运行应用。在工具栏的活动区域查看构建状态。' - 内容: 'If the build is successful, Xcode runs the app and opens a debugging session in the debug area. Use the controls in the debug area to step through your code, inspect variables, and interact with the debugger.' 提示: '' - 翻译: '' + 翻译: '如果构建成功,Xcode 会运行应用并在调试区域打开调试会话。使用调试区域中的控件逐步查看代码、检查变量并与调试器交互。' - 内容: 'If the build is unsuccessful, click the indicators in the activity area to read the error or warning messages in the Issue navigator. Alternatively, choose View > Navigators > Show Issue Navigator to view the messages.' 提示: '' - 翻译: '' + 翻译: '如果构建不成功,请单击活动区域中的指示器以阅读“问题”导航器中的错误或警告信息。或者选择“视图(View)” > “导航器(Navigators)” > “显示问题导航器(Show Issue Navigator)”查看信息。' - 内容: 'When you’re done testing the app, click the Stop button in the toolbar.' 提示: '' - 翻译: '' + 翻译: '完成应用测试后,单击工具栏中的“停止”按钮。' - 内容: 'Interact with the simulated environment' 提示: '' - 翻译: '' + 翻译: '与模拟环境交互' - 内容: 'If you choose a simulated device as the run destination, Simulator launches and displays a window that corresponds to the simulated environment. For some devices, Simulator surrounds the screen content with a shell that resembles the target device. In visionOS, it displays a synthetic space to mimic the experience someone would have when they wear the device.' 提示: '' - 翻译: '' + 翻译: '如果选择模拟设备作为运行目标,模拟器会启动并显示一个与模拟环境相对应的窗口。对于某些设备,模拟器会用一个与目标设备相似的外壳环绕屏幕内容。在 visionOS 中,模拟器会显示一个合成空间,以模拟佩戴设备时的体验。' - 内容: 'Each device shell and space has specific controls to support interactions. For device-specific details, see the reference on interactions.' 提示: '' - 翻译: '' + 翻译: '每个设备外壳和空间都有特定的控件来支持交互。有关特定设备的详细信息,请参阅有关交互参考资料。' - 内容: 'Interacting with your app in the iOS and iPadOS simulator' 提示: '' - 翻译: '' + 翻译: '在 iOS 和 iPadOS 模拟器中与应用交互' - 内容: 'Interacting with your app in the tvOS simulator' 提示: '' - 翻译: '' + 翻译: '在 tvOS 模拟器中与应用交互' - 内容: 'Interacting with your app in the watchOS simulator' 提示: '' - 翻译: '' + 翻译: '在 watchOS 模拟器中与应用交互' - 内容: 'Interacting with your app in the visionOS simulator' 提示: '' - 翻译: '' + 翻译: '在 visionOS 模拟器中与应用交互' From 74ccca0a5f3c03893e27175e68a5e63245af7332 Mon Sep 17 00:00:00 2001 From: Daniel Hu Date: Sat, 29 Jun 2024 15:44:06 +0900 Subject: [PATCH 2/2] Small fix --- .../Markdown/running-your-app-in-simulator-or-on-a-device.md | 4 ++-- .../visionos/running-your-app-in-simulator-or-on-a-device.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/project/visionos/Markdown/running-your-app-in-simulator-or-on-a-device.md b/project/visionos/Markdown/running-your-app-in-simulator-or-on-a-device.md index 11cef46..5ddb658 100644 --- a/project/visionos/Markdown/running-your-app-in-simulator-or-on-a-device.md +++ b/project/visionos/Markdown/running-your-app-in-simulator-or-on-a-device.md @@ -30,7 +30,7 @@ ### 将真实设备连接到 Mac -要查看和管理与真实设备的连接,请在 Xcode 的“设备和模拟器”窗口中选择“设备(Devices)”选项卡。“设备”选项卡显示当前已连接和断开连接的设备,可帮助你诊断可能出现的问题。例如,如果某个设备运行的操作系统版本不支持你的应用,Xcode 可能会将其显示为不可用。它还会显示可与 Xcode 配对的新设备。将设备与 Xcode 配对,以便将其包含在项目的运行目标列表中。 +要查看和管理与真实设备的连接,请在 Xcode 的“设备和模拟器(Devices and Simulators)”窗口中选择“设备(Devices)”选项卡。“设备”选项卡显示当前已连接和断开连接的设备,可帮助你诊断可能出现的问题。例如,如果某个设备运行的操作系统版本不支持你的应用,Xcode 可能会将其显示为不可用。它还会显示可与 Xcode 配对的新设备。将设备与 Xcode 配对,以便将其包含在项目的运行目标列表中。 要通过物理连接配对设备,请使用适当的连接线将设备连接到 Mac。解锁设备,并按照 Xcode 或设备上出现的任何指示操作。 @@ -44,7 +44,7 @@ 4. 在 Mac 上输入代码,完成配对过程。 -配对完成后,设备将显示在 Xcode 中“设备和模拟器”窗口的已连接设备下。在安装和运行应用时,无需将配对设备与 Mac 保持物理连接。如果你的设备连接到与 Mac 处于同一网络的 Wi-Fi,Xcode 就可以使用该链接来安装和运行你的应用。 +配对完成后,设备将显示在 Xcode 中“设备和模拟器(Devices and Simulators)”窗口的已连接设备下。在安装和运行应用时,无需将配对设备与 Mac 保持物理连接。如果你的设备连接到与 Mac 处于同一网络的 Wi-Fi,Xcode 就可以使用该链接来安装和运行你的应用。 要将 Apple Watch 与 Mac 配对,请使用数据线将其配套的 iPhone 与 Mac 连接,并确保 iPhone 已配对以进行开发。完成此步骤后,请按照 Apple Watch 上的指示信任 Mac。当通过运行 iOS 17 或更高版本的 iPhone 配对时,Xcode 会通过 Wi-Fi 连接到 Apple Watch。5 系列和更旧型号的 Apple Watch 还要求 Apple Watch 和 Mac 与同一个兼容 Bonjour 的 Wi-Fi 网络相关联。当通过运行旧版 iOS 的 iPhone 配对时,Xcode 要求 iPhone 与 Mac 保持连接,以便在任何型号的 Apple Watch 上进行开发。 diff --git a/project/visionos/running-your-app-in-simulator-or-on-a-device.yml b/project/visionos/running-your-app-in-simulator-or-on-a-device.yml index 99fc36a..de24889 100644 --- a/project/visionos/running-your-app-in-simulator-or-on-a-device.yml +++ b/project/visionos/running-your-app-in-simulator-or-on-a-device.yml @@ -48,7 +48,7 @@ 翻译: '将真实设备连接到 Mac' - 内容: 'To view and manage connections to your real devices, choose the Devices tab in the Devices and Simulators window in Xcode. The Devices tab shows the currently connected and disconnected devices and can help you diagnose problems that might occur. For example, Xcode might show a device as unavailable if it’s not running an operating system version your app supports. It also shows new devices available for pairing with your Xcode installation. Pair a device with Xcode to include them in the list of run destinations for your projects.' 提示: '' - 翻译: '要查看和管理与真实设备的连接,请在 Xcode 的“设备和模拟器”窗口中选择“设备(Devices)”选项卡。“设备”选项卡显示当前已连接和断开连接的设备,可帮助你诊断可能出现的问题。例如,如果某个设备运行的操作系统版本不支持你的应用,Xcode 可能会将其显示为不可用。它还会显示可与 Xcode 配对的新设备。将设备与 Xcode 配对,以便将其包含在项目的运行目标列表中。' + 翻译: '要查看和管理与真实设备的连接,请在 Xcode 的“设备和模拟器(Devices and Simulators)”窗口中选择“设备(Devices)”选项卡。“设备”选项卡显示当前已连接和断开连接的设备,可帮助你诊断可能出现的问题。例如,如果某个设备运行的操作系统版本不支持你的应用,Xcode 可能会将其显示为不可用。它还会显示可与 Xcode 配对的新设备。将设备与 Xcode 配对,以便将其包含在项目的运行目标列表中。' - 内容: 'To pair a device with a physical connection, connect the device to your Mac using an appropriate cable. Unlock the device and follow any instructions that appear in Xcode or on the device.' 提示: '' 翻译: '要通过物理连接配对设备,请使用适当的连接线将设备连接到 Mac。解锁设备,并按照 Xcode 或设备上出现的任何指示操作。' @@ -69,7 +69,7 @@ 翻译: '在 Mac 上输入代码,完成配对过程。' - 内容: 'After pairing is complete, the device shows up under connected devices in Devices and Simulators window in Xcode. You don’t need to keep a paired device physically connected to your Mac to install and run apps. If your device is connected to Wi-Fi on the same network as your Mac, Xcode can use that connection to install and run your app.' 提示: '' - 翻译: '配对完成后,设备将显示在 Xcode 中“设备和模拟器”窗口的已连接设备下。在安装和运行应用时,无需将配对设备与 Mac 保持物理连接。如果你的设备连接到与 Mac 处于同一网络的 Wi-Fi,Xcode 就可以使用该链接来安装和运行你的应用。' + 翻译: '配对完成后,设备将显示在 Xcode 中“设备和模拟器(Devices and Simulators)”窗口的已连接设备下。在安装和运行应用时,无需将配对设备与 Mac 保持物理连接。如果你的设备连接到与 Mac 处于同一网络的 Wi-Fi,Xcode 就可以使用该链接来安装和运行你的应用。' - 内容: 'To pair an Apple Watch to a Mac, connect its companion iPhone to the Mac with a cable, and ensure that the iPhone is paired for development. After this step, follow any instructions on the Apple Watch to trust the Mac. When paired through an iPhone running iOS 17 or later, Xcode connects to the Apple Watch over Wi-Fi. Series 5 and older models of Apple Watch additionally require the Apple Watch and Mac to be associated with the same Bonjour-compatible Wi-Fi network. When paired through an iPhone running older versions of iOS, Xcode requires the iPhone to remain connected to the Mac in order to develop on any model of Apple Watch.' 提示: '' 翻译: '要将 Apple Watch 与 Mac 配对,请使用数据线将其配套的 iPhone 与 Mac 连接,并确保 iPhone 已配对以进行开发。完成此步骤后,请按照 Apple Watch 上的指示信任 Mac。当通过运行 iOS 17 或更高版本的 iPhone 配对时,Xcode 会通过 Wi-Fi 连接到 Apple Watch。5 系列和更旧型号的 Apple Watch 还要求 Apple Watch 和 Mac 与同一个兼容 Bonjour 的 Wi-Fi 网络相关联。当通过运行旧版 iOS 的 iPhone 配对时,Xcode 要求 iPhone 与 Mac 保持连接,以便在任何型号的 Apple Watch 上进行开发。'