| 123456789101112131415161718 |
- <!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge"><![endif]--><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="Asciidoctor 1.5.4"><meta name="author" content="mitm"><title>How to build for iOS and publish to Apple App Store</title><link rel="stylesheet" href="./asciidoctor.css">
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css">
- <link rel="stylesheet" href="./coderay-asciidoctor.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.css"><link rel="stylesheet" href="/home/travis/build/jMonkeyEngine/wiki/build/asciidoc/html5/sdk/twemoji-awesome.css"></head><body class="article toc2 toc-left"><div id="header"><div id="toolbar"><a href="https://github.com/jMonkeyEngine/wiki/edit/master/src/docs/asciidoc/sdk/xcode_project.adoc"><i class="fa fa-pencil-square" aria-hidden="true"></i></a><a href="https://github.com/jMonkeyEngine/wiki/new/master/src/docs/asciidoc/sdk/"><i class="fa fa-plus-square" aria-hidden="true"></i></a><input dir="auto" style="position: relative; vertical-align: top;" spellcheck="false" autocomplete="off" class="searchbox__input aa-input" id="doc-search" name="search" placeholder="Search in the doc" required="required" type="search"></div><h1>How to build for iOS and publish to Apple App Store</h1><div class="details"><span class="author" id="author">mitm</span><br><span id="revnumber">version 1.0,</span> <span id="revdate">2-28-2020</span></div><div id="toc" class="toc2"><div id="toctitle">Table of Contents</div><ul class="sectlevel0"><li><a href="#building-on-ios">Building On iOS.</a></li></ul></div></div><div id="content"><h1 id="building-on-ios" class="sect0">Building On iOS.</h1><div class="paragraph"><p>There are a couple of updates required to the standard XCODE project generated by the system in order to build correctly.</p></div>
- <div class="olist arabic"><ol class="arabic"><li><p>After creating a <code>Basic Game</code> project in the jMonkeyEngine SDK, add the iOS library by <b class="button">RMB</b> selecting your project and navigating to <code><span class="menuseq"><span class="menu">Properties</span> ▸ <span class="submenu">Libraries</span> ▸ <span class="submenu">Add Library…​</span> ▸ <span class="menuitem">jme3-ios</span></span></code> and when ready <b class="button">Add Library</b> .</p><div class="imageblock"><div class="content"><img src="../sdk/xcode_add_ios_lib.jpg" alt="xcode_add_ios_lib.jpg"></div></div></li><li><p>In <code><span class="menuseq"><span class="menu">Properties</span> ▸ <span class="submenu">Application</span> ▸ <span class="menuitem">IOS</span></span></code> enable iOS deployment and make sure the iOS SDK Version is showing a number (Not Default). If there is no number present then you need to install XCODE. In this example, my SDK version is 11.3 and I’m using XCODE version 9.3</p><div class="openblock"><div class="content"><div class="imageblock"><div class="content"><img src="../sdk/xcode_enable_ios_deploy.jpg" alt="xcode_enable_ios_deploy.jpg"></div></div>
- <div class="paragraph"><p>When you press OK, after enabling iOS deployment and if not already installed, “AVIAN” will download and install. This is shown in the bottom status bar of the JME editor. Wait until this is finished before doing anything else.</p></div></div></div></li><li><p>Compile your project. If it’s missing <code>stdio.h</code> you need to install the xcode command line tools.</p><div class="olist loweralpha"><ol class="loweralpha" type="a"><li><p>Run this command in terminal:</p><div class="literalblock"><div class="content"><pre>xcode-select --install</pre></div></div></li><li><p>When it’s compiled successfully, load the XCODE PROJECT into XCODE, which is located in the IOS/PROJECT folder. As mentioned above, my SDK version is 11.3 and I’m using XCODE version 9.3</p></li></ol></div></li><li><p>First change the selected “TARGET” at the top of the screen from <code>iPhone 7 Plus</code> to <code>Generic iOS Device</code>. This is so we can do a full build. If you want to run it in a simulator then you can change it back later.</p><div class="imageblock"><div class="content"><img src="../sdk/xcode_generic_ios.jpg" alt="xcode_generic_ios.jpg"></div></div></li><li><p>From the “PROJECT” menu click <b class="button">BUILD</b> and the build will fail. Click the <b class="button">ISSUE NAVIGATOR</b> button to show the compilation errors.</p><div class="openblock"><div class="content"><div class="imageblock"><div class="content"><img src="../sdk/xcode_issue_nav.jpg" alt="xcode_issue_nav.jpg"></div></div>
- <div class="paragraph"><p>We can see here that the “Developer” account is missing, the project settings are out of date and there is a missing image for Retina 4-inch support.</p></div></div></div>
- <div class="olist loweralpha"><ol class="loweralpha" type="a"><li><p>Click <b class="button">Validate Project Settings</b> followed by <b class="button">PERFORM CHANGES</b> to accept all the suggested amendments.</p><div class="imageblock"><div class="content"><img src="../sdk/xcode_perform_changes.jpg" alt="xcode_perform_changes.jpg"></div></div></li><li><p>Click on the Missing Image warning and XCODE will automatically add a placeholder for you.</p><div class="imageblock"><div class="content"><img src="../sdk/xcode_add_placeholder.jpg" alt="xcode_add_placeholder.jpg"></div></div></li><li><p>Add your iOS developer account details by clicking on the target and then the Account Drop down.</p><div class="imageblock"><div class="content"><img src="../sdk/xcode_add_account.jpg" alt="xcode_add_account.jpg"></div></div></li></ol></div></li><li><p>Now click the PROJECT menu and BUILD again and it should compile now but fails at the linking stage.</p><div class="imageblock"><div class="content"><img src="../sdk/xcode_build.jpg" alt="xcode_build.jpg"></div></div></li><li><p>We need to amend the linker search paths.</p><div class="olist loweralpha"><ol class="loweralpha" type="a"><li><p>Click on <b class="button">PROJECT NAVIGATOR</b>.</p></li><li><p>Highlight the top row (JME-IOS).</p></li><li><p>Click <b class="button">jme-ios</b> under “PROJECT” (Not “TARGETS”).</p><div class="paragraph"><p>If you have done it correct then you will only see “INFO” & “BUILD SETTINGS” at the top.</p></div></li><li><p>Select <b class="button">BUILD SETTINGS</b>.</p></li><li><p>Scroll down to “LINKING” section.</p><div class="imageblock"><div class="content"><img src="../sdk/xcode_linking.jpg" alt="xcode_linking.jpg"></div></div></li><li><p>Double click on <b class="button">OTHER LINKER FLAGS</b>.</p><div class="imageblock"><div class="content"><img src="../sdk/xcode_linker_flags.jpg" alt="xcode_linker_flags.jpg"></div></div></li><li><p>Double click on the line referencing “i386” and change it from:</p><div class="openblock"><div class="content"><div class="paragraph"><p><code>…/…/build/ios-i386/libs.list</code></p></div>
- <div class="paragraph"><p>to</p></div>
- <div class="paragraph"><p><code>…/…/build/ios-x86_64/libs.list</code></p></div></div></div></li><li><p>Add the additional flag for “ARM64” sub type issue introduced in iOS SDK 11.</p><div class="openblock"><div class="content"><div class="ulist"><ul><li><p>With nothing selected click on the <b class="button">+</b> sign and a new entry will be added at the bottom.</p></li><li><p>In here add:</p><div class="paragraph"><p><code>-force_cpusubtype_ALL</code></p></div></li></ul></div></div></div>
- <div class="openblock"><div class="content"><div class="paragraph"><p>Your other linker flags should now look like this…</p></div>
- <div class="imageblock"><div class="content"><img src="../sdk/xcode_other_linker.png" alt="xcode_other_linker.png"></div></div></div></div></li></ol></div></li><li><p>Disable “BITCODE”.</p><div class="olist loweralpha"><ol class="loweralpha" type="a"><li><p>Click on <b class="button">PROJECT NAVIGATOR</b>.</p></li><li><p>Highlight the top row (JME-IOS).</p></li><li><p>Click <b class="button">jme-ios</b> under “TARGETS” (Not “PROJECT”).</p><div class="paragraph"><p>If you have followed the directions correctly, then you will see General/Capabilities/Resource Tags/Info/Build Settings/Build Phases/Build Rules at the top.</p></div></li><li><p>Select <b class="button">BUILD SETTINGS</b>.</p></li><li><p>Scroll down to “BUILD OPTIONS” section and change “ENABLE BITCODE” to “NO”.</p><div class="imageblock"><div class="content"><img src="../sdk/xcode_disable_bitcode.jpg" alt="xcode_disable_bitcode.jpg"></div></div></li></ol></div></li><li><p>From the “PROJECT” menu click "BUILD" and the project should build and link fully.</p></li><li><p>To publish to the “APP STORE” you select <code><span class="menuseq"><span class="menu">PROJECT</span> ▸ <span class="menuitem">ARCHIVE</span></span></code>.</p><div class="paragraph"><p>This will generate the App Store Archive and show in the organizer screen.</p></div>
- <div class="imageblock"><div class="content"><img src="../sdk/xcode_publish.png" alt="xcode_publish.png"></div></div></li><li><p>Click Upload to APP Store and away you go.</p></li></ol></div>
- <div class="paragraph"><p>You can follow the forum post on this subject <a href="https://hub.jmonkeyengine.org/t/how-to-build-for-ios-and-publish-to-apple-app-store/40920">here</a>.</p></div></div><div id="footer"><div id="footer-text">Version 1.0<br>Last updated 2020-02-28 19:01:09 +00:00</div></div><script type="text/javascript" src="https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.js"></script><script>docsearch({
- apiKey: 'a736b6d93de805e26ec2f49b55013fbd',
- indexName: 'jmonkeyengine',
- inputSelector: '#doc-search',
- debug: false // Set debug to true if you want to inspect the dropdown
- });</script></body></html>
|