问题描述
我一直在摆弄Xcode 7,我知道它只支持Swift 2,并且无法在Xcode 7中支持Swift 1.0或1.2。这很好。
I have been fiddling with Xcode 7 for sometime now, I get to know that it supports only Swift 2 and there is no way to support Swift 1.0 or 1.2 in Xcode 7. This is fine.
现在进入WatchOS,我可以在Xcode 7中分别为WatchOS1和WatchOS2分别设置两个目标,以便我可以同时支持这两个目标吗?
Now coming to WatchOS, can I have two targets one for WatchOS1 and one for WatchOS2 separately in Xcode 7 so that I can support for both??
我正在查看监视目标和iOS应用目标的构建设置中的部署目标设置,但我只能在列表中看到WatchOS2,所以
I was looking into the deployment target setting in the build settings of both the watch target and the iOS app target but I could see only WatchOS2 in the list so
-
我可以支持两个目标,一个用于WatchOS1& WatchOS2分别在Xcode 7中?如果是这样,我应该在某个地方安装WatchOS1 SDK?或
这完全不可能,如果不是为什么?。
如果两个目标都可以支持我怎么能防止两个目标的源重复,因为两个操作系统在架构方面都有很大的
差异。
同样自引入对于WatchConnectivity框架,iOS对应应用程序也会有一些变化,如何为这两个目标维持
?
我很困惑,我需要迅速做出决定,感谢任何帮助。
I am confused and I need to take a decision quickly, any help is appreciated.
推荐答案
你可以支持Xcode 7中的watchOS 1应用程序。
您还可以在Xcode 7中支持watchOS 2应用程序。
You can support watchOS 1 apps in Xcode 7.You can also support watchOS 2 apps in Xcode 7.
如果您想同时支持watchOS 1和watchOS 2那么你需要为每个操作系统设置单独的目标(由于架构上的差异)
If you want to support both watchOS 1 and watchOS 2 then you will need to have separate targets for each OS (due to the differences in architecture)
对于watchOS 1应用程序,添加一个新目标并选择 Apple Watch 部分e离开,然后从列表中单击 WatchKit App for watchOS 1 。
For a watchOS 1 app, add a new target and select the Apple Watch section from the left and then click on the WatchKit App for watchOS 1 from the list.
对于watchOS 2应用,添加新目标并选择 watchOS > 应用部分,然后点击列表中的 WatchKit应用选项。
For a watchOS 2 app, add a new target and select the watchOS > Application section and then click on the WatchKit App option in the list.
关于制作watchOS的一些注意事项Xcode 7中的1个应用程序(测试版1)...
Couple of things to note about making a watchOS 1 app in Xcode 7 (beta 1)...
因为我在运行iOS 8.3的iPhone 6和运行watchOS 1.0.1的手表上进行了测试,所以我需要将我的部署目标更改为iOS 8.3但请注意,您希望在项目级别而不仅仅是目标级别执行此操作(以便扩展也设置为8.3而不仅仅是主应用程序),否则它将不允许您部署在真实设备上。
Because I did my testing on an iPhone 6 running iOS 8.3 and my watch running watchOS 1.0.1, I needed to change my deployment target to iOS 8.3 but note that you want to do this at a project level rather than just target level (so that the extension also gets set to 8.3 and not just the main app) otherwise it won't let you deploy onto a real device.
由于Xcode 7 beta 1中的已知问题,观看了如果您的配对手机是64位,S 1应用程序将无法在真实手表上安装,并出现以下错误:
Due to a known issue in Xcode 7 beta 1, a watchOS 1 app will fail to install on a real watch with the following error if your paired phone is 64 bit:
Jun 20 17:25:08 Liams-iPhone companionappd[271] <Notice>: (Error) WatchKit: validateWatchKitApplicationInfoDictionary, invalid Info.plist key 'UIRequiredDeviceCapabilities'
这是因为Xcode 7在构建时将arm64添加到 UIRequiredDeviceCapabilities
info.plist键,甚至在你的watchOS 1扩展时也是如此不会。
This is because Xcode 7 is adding arm64 to the UIRequiredDeviceCapabilities
info.plist key at build time even to your watchOS 1 extension when it shouldn't be.
您可以通过将仅构建活动架构设置为否$ c来暂时解决此问题$ c>用于DEBUG模式。
You can temporarily get around this by setting Build Active Architecture Only to NO
for DEBUG mode.
希望有帮助
这篇关于Xcode 7支持手表OS1和OS2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!