使用xCode命令行工具时崩溃加载SKTextureAtlas - 更好的答案?

时间:2014-08-17 12:24:15

标签: xcode5 continuous-integration ios7.1

我的iOS7项目使用SpriteKit和多个SKTextureAtlas。我可以使用xCode5.1.1构建并运行它而没有任何问题。

尝试使用xCode Command Line Tools的构建服务器运行.ipa构建,在尝试加载第一个纹理图集时,它会在启动时崩溃:

Last Exception Backtrace: 0 CoreFoundation 0x18de52f50 __exceptionPreprocess + 132 1 libobjc.A.dylib 0x19a35c1fc objc_exception_throw + 60 2 CoreFoundation 0x18de52e90 +[NSException raise:format:] + 128 3 SpriteKit 0x190cdc4f8 -[SKTextureAtlas loadTextures] + 2708 4 SpriteKit 0x190cdd440 +[SKTextureAtlas atlasNamed:] + 208 . .

目录myTextures.atlas包含在.app内容以及实际的.png文件中。

编辑:

似乎Command Line Tools忽略Enable Texture Atlas Generation构建设置。

我可以通过以下方式解决这个问题:

  • 将构建设置Enable Texture Atlas Generation设置为否

  • 将以下内容添加为Build Phrase shell脚本:

cd "$CONFIGURATION_BUILD_DIR"/*.app
/Applications/Xcode.app/Contents/Developer/usr/bin/TextureAtlas myAtlas.atlas

我认为这是一个Apple bug并提交了它,但更好的解决方案受到高度赞赏!

0 个答案:

没有答案