![]()
然后我通过设置“游戏”为我的项目添加了一个watchOS目标
文件>新>目标:
我检查了WatchExtension中的GameScene.swift,确定所有代码都在那里并设置了一个场景:
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 } } 不幸的是,我似乎无法在Apple Watch Simulator上安装它.
我已经尝试了我能想到的一切,包括:
>清洁建筑等
>卸载/重新安装,
>查看了info.pList for common errors,
>使用Add Additional Simulators创建一个带有配对Apple Watch的新模拟器,
>已添加Skip Install =否,建议here,
>从iPhone模拟器中的配对iOS Apple Watch App安装(只是不安装),
>甚至添加了用户定义的项目设置,如raywenderlich watchOS教程中所建议的……
我甚至无法安装或出现在Apple Watch上.我不做什么?
UPDATE
我已经为iOS应用程序调整了部署目标到10.0,我终于能够从iPhone模拟器中的Apple Watch应用程序安装它,除了从Apple Watch Simulator启动Apple Watch App之外,我收到以下错误:
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)
这个错误是什么意思?不应该加载任何图像,因为它是默认的SpriteKit测试…
解决方法 可能不是真正的解决方案,但是在我尝试各种各样的事情后发现的一个解决方法被发现 here,on Stackoverflow,因为错误发生在我上面的问题的底部.因此,如果您将应用程序转换为Swift 3.0,将watchOS“游戏”目标添加到您的项目中,将iOS部署目标更改为10.0并在WatchOS 3.0模拟器和iPhone 6s iOS 10模拟器上运行,请更新以下设置:
将NO更改为YES:
Project > Targets > App name > Embed Asset Packs In Product Bundle = YES
并且“你好,世界!”应该出现在Apple Watch上,带有旋转的脉冲spriteNode(屏幕截图中未显示,因为它没有足够快地捕获它).
请注意,您可能必须通过启动Apple Watch App,点击您的应用程序,然后按“Apple Watch上的显示”,从iPhone模拟器安装Apple Watch App中的应用程序.
总结以上是内存溢出为你收集整理的Apple Watch Simulator上的watchOS中运行SpriteKit游戏(xCode 8,Swift 3,iOS 10) – libswiftSwiftOnoneSupport错误全部内容,希望文章能够帮你解决Apple Watch Simulator上的watchOS中运行SpriteKit游戏(xCode 8,Swift 3,iOS 10) – libswiftSwiftOnoneSupport错误所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)