Explorar el Código

Merged two ios documents into one.

mitm hace 5 años
padre
commit
bb7b3007b2
Se han modificado 2 ficheros con 122 adiciones y 17 borrados
  1. 121 16
      src/docs/asciidoc/jme3/ios.adoc
  2. 1 1
      src/docs/asciidoc/sdk/xcode_project.adoc

+ 121 - 16
src/docs/asciidoc/jme3/ios.adoc

@@ -1,10 +1,11 @@
 = ios
-:author: 
-:revnumber: 
+:author:
+:revnumber:
 :revdate: 2016/03/17 20:48
 :keywords: documentation, iOS, Mac, MacOS, deployment, platform
 :relfileprefix: ../
 :imagesdir: ..
+:experimental:
 ifdef::env-github,env-browser[:outfilesuffix: .adoc]
 
 
@@ -22,19 +23,34 @@ Note that at the moment iOS deployment is in alpha state.
 
 iOS deployment works via cross-compilation to native iOS ARM code, there is no virtual machine running on the device. The Avian JVM supports this feature while maintaining general compatibility to OpenJDK and JNI for native access. The minimum compatible iOS deployment target is 4.3.
 
+After creating a `Basic Game` project in the jMonkeyEngine SDK, add the iOS library by btn:[RMB] selecting your project and navigating to `menu:Properties[Libraries > Add Library... > jme3-ios]` and when ready btn:[Add Library].
+
+image::sdk/xcode_add_ios_lib.jpg[xcode_add_ios_lib.jpg]
+
 
 [TIP]
 ====
-To install the iOS deployment plugin, go to Tools→Plugins and under “Available plugins select the “iOS Support plugin.
+To install the iOS deployment plugin, go to menu:Tools[Plugins] and under "`Available Plugins`" select:
+
+- [x] iOS Support
+
+If you dont see it there, check under the "`Installed`" tab as it may already be activated.
 ====
 
 
 
 === Enabling iOS deployment
 
-To enable iOS deployment, go to the project settings and under “Application→iOS select the “Enable iOS deployment checkbox, adapt the application ID and then press OK.
 
-image:jme3/ios-deployment.png[ios-deployment.png,width="",height=""]
+To enable iOS deployment, go to the project settings and under menu:Application[iOS] select:
+
+- [x] Enable iOS deployment
+
+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
+
+image::sdk/xcode_enable_ios_deploy.jpg[xcode_enable_ios_deploy.jpg]
+
+Then adapt the application ID and press btn:[OK].
 
 After enabling deployment, a new `ios` directory is created in the project root that contains a `project` and a `src` folder. The `ios/project` folder contains an Xcode project that you will use to build and run the final iOS application for both iPhone and iOS. The `ios/src` folder contains java and native source files for bridging iOS and native code, you can add .java and .m files with your own iOS code here.
 
@@ -48,26 +64,115 @@ When you enable iOS deployment for the first time or any time that the Avian lib
 
 === Building the iOS binaries
 
-The iOS binaries are automatically built when you have iOS deployment enabled and build your project in the jME3 SDK.
+Compile your project. The iOS binaries are automatically built when you have iOS deployment enabled and build your project in the jME3 SDK.
 
-When the iOS binaries are built, all needed classes, including a complete copy of the OpenJDK7 classes are run through a proguard process that strips out the unnecessary classes for the project and optimizes the code for the platform. This happens without changing the naming structure so that reflection etc. still works. If necessary, adapt the proguard options in the ios properties file.
+When the iOS binaries are built, all needed classes, including a complete copy of the OpenJDK classes are run through a proguard process that strips out the unnecessary classes for the project and optimizes the code for the platform. This happens without changing the naming structure so that reflection etc. still works. If necessary, adapt the proguard options in the ios properties file.
 
 After the iOS classpath has been created the avian compiler is used to create a native .o file from the classpath for both arm (device) and i386 (simulator). Furthermore the other needed avian .o files are extracted and a library list is compiled which is referenced in the Xcode project.
 
-If an error occurs about jni.h not being found, either install the SDK for 10.9 in XCode or set the header search path in the XCode project settings, in the default project thats +
-`/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/` +
-`SDKs/MacOSX10.9.sdk/System/Library/Frameworks/JavaVM.framework/Headers/`
+If an error occurs about jni.h not being found, either install the SDK for 11.3 in XCode:
 
+Run this command in terminal:
 
-=== Running and deploying the application
+ xcode-select --install
 
-To run the application, open the Xcode project under `ios/project` in Xcode and press the run button. You can make changes to the UI and native invocation classes in the Xcode project as well. From here you can also deploy the application to your devices or the App Store.
+or set the header search path in the XCode project settings, in the default project thats +
 
-[TIP]
-====
-Note that you should also adapt the project settings like application name and registration package in Xcode before deploying the final application.
-====
+ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/JavaVM.framework/Headers/
+
+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
+
+
+=== Running and deploying the application
 
+To run the application, open the Xcode project under `ios/project` in Xcode and press the run button.  You can make changes to the UI and native invocation classes in the Xcode project as well. From here you can also deploy the application to your devices or the App Store.
+
+You should also adapt the project settings like application name and registration package in Xcode before deploying the final application.
+
+. First change the selected "`TARGET`" at the top of the screen from `iPhone 7 Plus` to `Generic iOS Device`. 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.
++
+image::sdk/xcode_generic_ios.jpg[xcode_generic_ios.jpg]
+
+. From the "`PROJECT`" menu click btn:[BUILD] and the build will fail. Click the btn:[ISSUE NAVIGATOR] button to show the compilation errors.
++
+--
+image::sdk/xcode_issue_nav.jpg[xcode_issue_nav.jpg]
+
+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.
+--
+
+.. Click btn:[Validate Project Settings] followed by btn:[PERFORM CHANGES] to accept all the suggested amendments.
++
+image::sdk/xcode_perform_changes.jpg[xcode_perform_changes.jpg]
+
+.. Click on the Missing Image warning and XCODE will automatically add a placeholder for you.
++
+image::sdk/xcode_add_placeholder.jpg[xcode_add_placeholder.jpg]
+
+.. Add your iOS developer account details by clicking on the target and then the Account Drop down.
++
+image::sdk/xcode_add_account.jpg[xcode_add_account.jpg]
+
+. Now click the "`PROJECT`" menu and "`BUILD`" again and it should compile now but fails at the linking stage.
++
+image::sdk/xcode_build.jpg[xcode_build.jpg]
+
+. We need to amend the linker search paths.
+.. Click on btn:[PROJECT NAVIGATOR].
+.. Highlight the top row (JME-IOS).
+.. Click btn:[jme-ios] under "`PROJECT`" (Not "`TARGETS`").
++
+If you have done it correct then you will only see "`INFO`" & "`BUILD SETTINGS`" at the top.
+.. Select btn:[BUILD SETTINGS].
+.. Scroll down to "`LINKING`" section.
++
+image::sdk/xcode_linking.jpg[xcode_linking.jpg]
+.. Double click on btn:[OTHER LINKER FLAGS].
++
+image::sdk/xcode_linker_flags.jpg[xcode_linker_flags.jpg]
+.. Double click on the line referencing "`i386`" and change it from:
++
+--
+`…/…/build/ios-i386/libs.list`
+
+to
+
+`…/…/build/ios-x86_64/libs.list`
+--
+.. Add the additional flag for "`ARM64`" sub type issue introduced in iOS SDK 11.
++
+--
+* With nothing selected click on the btn:[+] sign and a new entry will be added at the bottom.
+* In here add:
++
+`-force_cpusubtype_ALL`
+--
++
+--
+Your other linker flags should now look like this…
+
+image::sdk/xcode_other_linker.png[xcode_other_linker.png]
+--
+. Disable "`BITCODE`".
+.. Click on btn:[PROJECT NAVIGATOR].
+.. Highlight the top row (JME-IOS).
+.. Click btn:[jme-ios] under "`TARGETS`" (Not "`PROJECT`").
++
+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.
+.. Select btn:[BUILD SETTINGS].
+.. Scroll down to "`BUILD OPTIONS`" section and change "`ENABLE BITCODE`" to "`NO`".
++
+image::sdk/xcode_disable_bitcode.jpg[xcode_disable_bitcode.jpg]
+
+. From the "`PROJECT`" menu click "BUILD" and the project should build and link fully.
+
+. To publish to the "`APP STORE`" you select the "`PROJECT`" menu and "`ARCHIVE`".
++
+This will generate the App Store Archive and show in the organizer screen.
++
+image::sdk/xcode_publish.png[xcode_publish.png]
+
+. Click Upload to APP Store and away you go.
 
 
 === Creating native and java code for iOS

+ 1 - 1
src/docs/asciidoc/sdk/xcode_project.adoc

@@ -12,7 +12,7 @@ ifdef::env-github,env-browser[:outfilesuffix: .adoc]
 
 There are a couple of updates required to the standard XCODE project generated by the system in order to build correctly.
 
-. After creating a `Basic Game` project in the jMonkeyEngine SDK, add the iOS library by btn:[RMB] selecting your project and navigating to `menu:Properties[Libraries > Add Library... > jme3-ios]` and when ready btn:[Add Library] .
+. After creating a `Basic Game` project in the jMonkeyEngine SDK, add the iOS library by btn:[RMB] selecting your project and navigating to `menu:Properties[Libraries > Add Library... > jme3-ios]` and when ready btn:[Add Library].
 +
 image::sdk/xcode_add_ios_lib.jpg[xcode_add_ios_lib.jpg]