libgdx IDEA 发布ipa到AppStore
相关文章
https://www.reddit.com/r/libgdx/comments/ayrdmj/porting_libgdx_game_to_ios_via_multios_engine_or/
https://medium.com/@bschulte19e/deploying-your-libgdx-game-to-ios-in-2019-8d3796410d82
在不清楚怎么用自己喜欢的开发环境发布app是一件很痛苦的事。经过一番google和蒙之后,终于成功提交build到AppStore。再次总结一下注意点,希望能看见这篇嫖客的小伙伴都少走弯路。
- 在父项目的build.gradle中的project(":ios")中添加以下配置证书(红色字体)
project(":ios") {
apply plugin: "java"
apply plugin: "robovm"
configurations { natives }
dependencies {
compile project(":core")
compile "org.robovm:robovm-rt:${roboVMVersion}"
compile "org.robovm:robovm-cocoatouch:${roboVMVersion}"
compile "com.badlogicgames.gdx:gdx-backend-robovm:$gdxVersion"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-ios"
compile fileTree(dir: 'libs', include: '*.jar')//add at 20140828 for 内购
}
robovm {
iosSignIdentity = "iPhone Distribution: XXXXXXXXXXXX"
iosProvisioningProfile = "xxxxx"
}
}
复制代码
注意iosSignIdentity里填的是钥匙串里的名字,而不是Xcode里看到的。我的Xcode里看到的是iOS Distribution,一直报找不到。
至于怎么弄证书就自己google吧,不复杂。
-
运行gradle的ios [createIPA]命令,创建ipa。
-
在iTunes Connect创建对应的App,下载ApplicationLoader并上传ipa。
补充:
- Info.plist.xml设定仅提供给iPhone
<key>UIDeviceFamily</key> <array> <integer>1</integer><!--iPhone/iPod--> <!--<integer>2</integer>iPad--> </array>
- Info.plist.xml设定仅使用竖屏
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<!--<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>-->
</array>
- 增加iOS7的120×120的icon,文件名可以是Icon-60@2x.png
<key>CFBundleIcons</key>
<dict>
<key>CFBundlePrimaryIcon</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>Icon</string>
<string>Icon-72</string>
<string>Icon-60</string>
</array>
</dict>
</dict>
复制代码
- 再次提交前,createIPA前修改版本号robovm.properties
app.version, app.build