xcode 出于开发目的,我如何模拟 Apple Watch?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/25756413/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How can I simulate the Apple Watch for development purposes?
提问by Undo
I just downloaded the Xcode 6 GM, and I'd like to see how my apps work with an Apple Watch connected to the simulated iPhone.
我刚刚下载了 Xcode 6 GM,我想看看我的应用程序如何与连接到模拟 iPhone 的 Apple Watch 配合使用。
How can I simulate this new device on my MacBook?
如何在我的 MacBook 上模拟这个新设备?
回答by Artem Loginov
- Install Xcode (starting from 6.2) (link)
- Add Apple Watch target to your project (
New->Target->Apple Watch->Watch App
) - Go to
iOS Simulator -> Hardware -> External displays
and select any Apple Watch options - Choose
'[your project] Watch App'
target and Run
- 安装 Xcode(从 6.2 开始)(链接)
- 将 Apple Watch 目标添加到您的项目 (
New->Target->Apple Watch->Watch App
) - 前往
iOS Simulator -> Hardware -> External displays
并选择任何 Apple Watch 选项 - 选择
'[your project] Watch App'
目标并运行
Have fun! :)
玩得开心!:)
回答by Jeremy Huddleston Sequoia
Xcode 6.0 does not support development for Apple Watch.
Xcode 6.0 不支持 Apple Watch 的开发。
Xcode 6.2 supports development using WatchKit. Check out the WatchKit Programming Guidewhich includes some examples and note issues reported in the Xcode 6.2 Beta Release Notes. Furthermore, be aware that most of the simulator issues mentioned in the Xcode 6.1 Release Notesstill apply but were unfortunately omitted from the 6.2 notes.
Xcode 6.2 支持使用 WatchKit 进行开发。查看WatchKit 编程指南,其中包括一些示例并注意Xcode 6.2 Beta 发行说明中报告的问题。此外,请注意Xcode 6.1 发行说明中提到的大多数模拟器问题仍然适用,但遗憾的是在 6.2 说明中被省略了。
Xcode does not support development of native apps for Apple Watch, but it was announced as coming in 2015.
Xcode 不支持为 Apple Watch 开发本机应用程序,但它于 2015 年宣布推出。
回答by Undo
Apple has announced WatchKit. Here's an example of what the WatchKit simulator looks like, from the "getting started" video:
Apple 已经发布了WatchKit。以下是“入门”视频中 WatchKit 模拟器外观的示例:
There's also a WatchKit programming guideand framework reference, which seem to reveal quite a bit about how the Apple Watch will work.
还有一个WatchKit 编程指南和框架参考,它似乎揭示了很多关于 Apple Watch 将如何工作的信息。
回答by MCP
Also note that while you can't exactly simulate what will truly be available to developers for the Watch, Apple has announced "WatchKit," which is theplatform developers will use.
另请注意,虽然您无法准确模拟 Watch 开发人员真正可用的内容,但 Apple 已宣布“WatchKit”,这是开发人员将使用的平台。
Unfortunately, there has been no release date set.
不幸的是,尚未确定发布日期。
回答by Viper
Watchkit is coming out in November of 2014. They will likely add the simulator in Xcode then.
Watchkit 将于 2014 年 11 月推出。届时他们可能会在 Xcode 中添加模拟器。
回答by iSwaroop
You must have Xcode 6.2+ to develop app/extension using WatchKit.
你必须有 Xcode 6.2+ 才能使用 WatchKit 开发应用程序/扩展。
This guide gives detailed information about apple watch development including how to run apple watch app in simulator.
本指南提供了有关 Apple Watch 开发的详细信息,包括如何在模拟器中运行 Apple Watch 应用程序。