将否"更改为是":Project > Targets > App Name > Embed Asset Packs In Product Bundle = YES你好,世界!"应该出现在Apple Watch上,带有一个旋转的,脉冲状的spriteNode(未在屏幕快照中显示,因为捕获速度不够快). 请注意,您可能需要通过启动Apple Watch App,单击您的应用程序并按在Apple Watch上显示",从iPhone Simulator的Apple Watch App中安装该应用程序.I downloaded xCode 8.0 beta and opened a recent project written in swift 2 which I then converted to swift 3 using xCode.I then added a watchOS target to my project with the setting "game"File > New > Target:I checked the GameScene.swift in the WatchExtension and sure enough all the code is there and sets up a scene: import SpriteKit class GameScene: SKScene { private var spinnyNode : SKShapeNode? override func sceneDidLoad() { if let label = self.childNode(withName: "//helloLabel") as? SKLabelNode { label.alpha = 0.0 label.run(SKAction.fadeIn(withDuration: 2.0)) } let w = (self.size.width + self.size.height) * 0.05 let spinnyNode = SKShapeNode(rectOf: CGSize(width: w, height: w), cornerRadius: w * 0.3) spinnyNode.position = CGPoint(x: 0.0, y: 0.0) spinnyNode.strokeColor = UIColor.red() spinnyNode.lineWidth = 8.0 spinnyNode.run(SKAction.sequence([SKAction.wait(forDuration: 0.5), SKAction.fadeOut(withDuration: 0.5), SKAction.removeFromParent()])) spinnyNode.run(SKAction.repeatForever(SKAction.rotate(byAngle: 6.28, duration: 1))) self.run(SKAction.repeatForever(SKAction.sequence([SKAction.wait(forDuration: 2.0), SKAction.run({ let n = spinnyNode.copy() as! SKShapeNode self.addChild(n) })]))) } override func update(_ currentTime: TimeInterval) { // Called before each frame is rendered } }Unfortunately I can't seem to get this to install on the Apple Watch Simulator.I've tried everything I can think of, including:Clean builds, etcUninstall/reinstall,Checked info.plist for common errors,Created a new simulator with paired Apple Watch using Add Additional Simulators,Added Skip Install = No, suggested here,Install from Paired iOS Apple Watch App in iPhone Simulator (just doesn't install),Even added user defined project settings, as suggested in a raywenderlich watchOS tutorial...I just can't get it to even install or appear on the Apple Watch. what am I not doing?UPDATEI have adjusted the Deployment Target to 10.0 for the iOS App and I was finally able to install it from the Apple Watch app in the iPhone Simulator, except upon launching the Apple Watch App from the Apple Watch Simulator, I get the following error:dyld: Library not loaded: @rpath/libswiftSwiftOnoneSupport.dylibReferenced from: /Users/MYNAME/Library/Developer/CoreSimulator/Devices/XXXXXX-XXXX-XXXX-XXXX/data/Containers/Bundle/Application/XXXXXX-XXXX-XXXX-XXXX/MYAPPNAME.app/PlugIns/MYAPPWATCH Extension.appex/MYAPPWATCH ExtensionReason: image not found(lldb) What does this error mean? There shouldn't be any images to load as it's the default SpriteKit test... 解决方案 Probably not the real solution, but a work around that I found after hours of trying various things was found here, on Stackoverflow, for the Error occurring at the bottom of my question above.So if you convert your App to Swift 3.0, Add a watchOS "game" Target to your project, change iOS Deployment Target to 10.0 and run on WatchOS 3.0 Simulator and iPhone 6s iOS 10 Simulator, update the following setting:Change NO to YES:Project > Targets > App Name > Embed Asset Packs In Product Bundle = YESAnd "Hello, World!" should appear on the Apple Watch, with a spinning, pulsing spriteNode (not shown in screenshot as didn't capture it quick enough).Please note, you may have to install the App from the Apple Watch App from the iPhone Simulator by launching the Apple Watch App, clicking your app, and pressing "show on Apple Watch". 这篇关于在Apple Watch Simulator(xCode 8,Swift 3,iOS 10)的watchOS中运行SpriteKit Game-libswiftSwiftOnoneSupport错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-23 17:16