Sprite Kit应用程序在真实设备上运行并插入计算机时崩溃 [英] Sprite Kit app crashes when run on real device and plugged into computer

查看:475
本文介绍了Sprite Kit应用程序在真实设备上运行并插入计算机时崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚在我的测试手机和XCode 8上更新了iOs10。我运行了代码迁移,并在我的模拟设备上成功运行了测试。

I just updated to iOs10 on my test phone and XCode 8. I ran the code migration and was running tests succeessfully on my simulated devices.

然而,一旦我开始尝试在我的真实设备上进行测试,事情就会停止顺利进行。运行我的Sprite Kit游戏约5-10秒后,它会崩溃并使手机无法操作,直到我从计算机上拔下它。在我拔掉电源后,游戏正常运行并且仍然非常流畅。

However, once I started trying to test on my real device things stopped working smoothly. After running my Sprite Kit game for around 5 - 10 seconds it would crash and render the phone inoperable until I unplugged it from the computer. After I unplug it the game runs as normal and is still really smooth.

这是打印到控制台的启动通知:

This are the startup notifications printed to the console:

2016-09-15 22:20:49.490959 AppName[411:38688] [DYMTLInitPlatform] platform initialization successful
2016-09-15 22:20:49.684189 AppName[411:38634] Metal GPU Frame Capture Enabled
2016-09-15 22:20:49.684758 AppName[411:38634] Metal API Validation Enabled

这是手机插入电话后应用崩溃时收到的错误:

This is the error I receive after the app crashes when the phone is plugged in:

/BuildRoot/Library/Caches/com.apple.xbs/Sources/Metal/Metal-85.83/ToolsLayers/Debug/MTLDebugRenderCommandEncoder.mm:130: failed assertion `indexBufferOffset(12) + (indexCount(480) * 2) must be <= [indexBuffer length](960).'
(lldb) 


推荐答案

尝试通过编辑方案禁用金属验证:

try to disable Metal verification by editing the scheme:


  1. (Command-Option-R )

  2. 转到选项选项卡。

  3. 将金属API验证设置为已禁用。

这对我有用......

This worked for me...

这篇关于Sprite Kit应用程序在真实设备上运行并插入计算机时崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆