Nathan
Nathan

Reputation: 194

Sprite Kit app crashes when run on real device and plugged into computer

I just updated to iOS 10 on my test phone and Xcode 8. I ran the code migration and was running tests successfully on my simulated devices.

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) 

Upvotes: 6

Views: 947

Answers (3)

acidbeast
acidbeast

Reputation: 43

  • Command-Option-R
  • "Wait for executable to be launched"
  • manual run

works for me from time to time.

Upvotes: 0

Jorge Paiz
Jorge Paiz

Reputation: 506

I can resolve this, unchecking "Debug executable" in the Scheme enter image description here

Upvotes: 0

Setera
Setera

Reputation: 297

try to disable Metal verification by editing the scheme:

  1. (Command-Option-R)
  2. go to the Options tab.
  3. Set Metal API Validation to Disabled.

This worked for me...

Upvotes: 2

Related Questions