2012-03-09 15:52:31 +00:00
|
|
|
.. _packaging_ios:
|
|
|
|
|
|
|
|
Create a package for IOS
|
|
|
|
========================
|
|
|
|
|
2012-07-07 21:24:02 +00:00
|
|
|
.. versionadded:: 1.2.0
|
|
|
|
|
2012-03-09 15:52:31 +00:00
|
|
|
.. warning::
|
|
|
|
|
|
|
|
This method is still under development.
|
|
|
|
|
2012-03-09 16:32:23 +00:00
|
|
|
The overall method for creating a package on IOS can be explained in 4 steps:
|
2012-03-09 15:52:31 +00:00
|
|
|
|
|
|
|
#. Compile python + modules for IOS
|
|
|
|
#. Create an Xcode project
|
|
|
|
#. Populate the Xcode project with your application source code
|
|
|
|
#. Customize
|
|
|
|
|
2012-07-07 21:06:05 +00:00
|
|
|
The current method have been tested with Xcode 4.2
|
2012-03-09 15:52:31 +00:00
|
|
|
|
2012-07-07 21:06:05 +00:00
|
|
|
Prerequisites
|
|
|
|
-------------
|
|
|
|
|
|
|
|
You need to install some dependencies, like cython or mercurial. If you're
|
|
|
|
using Xcode 4.3, then you also need to install autotools. We encourage you to
|
|
|
|
use `Homebrew <http://mxcl.github.com/homebrew/>`_ to install thoses dependencies::
|
|
|
|
|
|
|
|
brew install cython autoconf automake libtool pkg-config mercurial
|
|
|
|
brew link libtool
|
|
|
|
brew link mercurial
|
|
|
|
|
|
|
|
Ensure that everything is ok before starting the second step!
|
2012-03-09 15:52:31 +00:00
|
|
|
|
2012-08-17 00:19:14 +00:00
|
|
|
.. _Compile the distribution:
|
|
|
|
|
2012-03-09 15:52:31 +00:00
|
|
|
Compile the distribution
|
|
|
|
------------------------
|
|
|
|
|
|
|
|
Open a terminal, and::
|
|
|
|
|
|
|
|
$ git clone git://github.com/kivy/kivy-ios
|
|
|
|
$ cd kivy-ios
|
|
|
|
$ tools/build-all.sh
|
|
|
|
|
|
|
|
If you don't want to compile all the things needed for kivy, edit and change
|
2012-03-09 16:32:23 +00:00
|
|
|
`tools/build-all.sh` to your needs.
|
2012-03-09 15:52:31 +00:00
|
|
|
|
2012-03-09 16:32:23 +00:00
|
|
|
Most of the python distribution will be packed into a `python27.zip`.
|
2012-03-09 15:52:31 +00:00
|
|
|
|
2012-08-17 00:19:14 +00:00
|
|
|
.. _Create an Xcode project:
|
2012-03-09 15:52:31 +00:00
|
|
|
|
|
|
|
Create an Xcode project
|
|
|
|
-----------------------
|
|
|
|
|
2012-09-25 17:53:10 +00:00
|
|
|
Before doing the next step, ensure your application entry point is a file named
|
|
|
|
`main.py`.
|
|
|
|
|
2012-03-09 15:52:31 +00:00
|
|
|
We provide a script that create an initial xcode project to start with (replace
|
|
|
|
test with that you want. Must be a name without any space / weird chars)::
|
|
|
|
|
2012-05-10 19:32:48 +00:00
|
|
|
$ tools/create-xcode-project.sh test /path/to/your/appdir
|
2012-03-09 15:52:31 +00:00
|
|
|
|
|
|
|
Now you can open the Xcode project::
|
|
|
|
|
|
|
|
$ open app-test/test.xcodeproj
|
|
|
|
|
2012-08-17 00:19:14 +00:00
|
|
|
.. _Customize:
|
2012-03-09 15:52:31 +00:00
|
|
|
|
|
|
|
Customize
|
|
|
|
---------
|
|
|
|
|
|
|
|
You can customize the build in many ways:
|
|
|
|
|
|
|
|
#. Minimize the `build/python/lib/python27.zip`: this contain all the python
|
|
|
|
modules. You can edit the zip file, and remove all the files you'll not use
|
|
|
|
(reduce encodings, remove xml, email...)
|
|
|
|
#. Remove the .a not used: in Xcode, select your target, go in `Build Phases`,
|
|
|
|
then check the `Link Binary With Libraries`. You can remove the libraries
|
|
|
|
not used by your application.
|
|
|
|
#. Change the icon, orientation, etc... According to the Apple policy :)
|
2012-05-17 12:06:06 +00:00
|
|
|
#. Go to the settings panel > build, search for "strip" options, and
|
|
|
|
triple-check that they are all set to NO. Stripping is not working with
|
|
|
|
Python dynamic modules, and will strip needed symbols.
|
2012-03-09 15:52:31 +00:00
|
|
|
|
2012-08-17 00:19:14 +00:00
|
|
|
.. _Known issues:
|
2012-03-09 15:52:31 +00:00
|
|
|
|
|
|
|
Known issues
|
|
|
|
------------
|
|
|
|
|
2012-03-11 21:53:18 +00:00
|
|
|
Currently, the project have few issues as (we'll fixes them during the
|
|
|
|
development):
|
2012-03-09 15:52:31 +00:00
|
|
|
|
|
|
|
- Loading time: Apple provide a way to reduce the feeling of a slow application
|
|
|
|
loading by showing an image when the application is initialize. But, due to
|
|
|
|
the SDL approach, IOS remove the launch image before we have started. So if
|
|
|
|
you are using a launch image, the user will see: The launch image -> black
|
|
|
|
screen -> your app. Remove the launch image for now.
|
|
|
|
|
|
|
|
- Application configuration not writing: we are learning how IOS manage its
|
2012-03-11 21:53:18 +00:00
|
|
|
filesystem.
|
|
|
|
|
|
|
|
- You can't export your project outside kivy-ios directory, because the
|
|
|
|
libraries included in the project are relative to it.
|
|
|
|
|
|
|
|
- Removing some libraries (like SDL_Mixer for the sound) is currently not
|
|
|
|
possible cause kivy project need it.
|
2012-03-09 15:52:31 +00:00
|
|
|
|
|
|
|
- And more, just too technical to be written here.
|
|
|
|
|
2012-08-17 00:19:14 +00:00
|
|
|
.. _ios_packaging_faq:
|
|
|
|
|
2012-03-09 15:52:31 +00:00
|
|
|
FAQ
|
|
|
|
---
|
|
|
|
|
2012-08-02 14:09:46 +00:00
|
|
|
Application quit abnormally!
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
By default, all the print on the console and files are avoided. If you have an
|
|
|
|
issue when running your application, you can activate the log by commenting the
|
|
|
|
line in the main.m::
|
|
|
|
|
|
|
|
putenv("KIVY_NO_CONSOLELOG=1");
|
|
|
|
|
|
|
|
Then, you should see all the Kivy log on the Xcode console.
|
|
|
|
|
2012-03-09 15:52:31 +00:00
|
|
|
How Apple can accept a python app ?
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
We managed to merge the app binary with all the libraries into only one binary,
|
|
|
|
as libpython. At the end, all binaries modules are already loaded, nothing is
|
|
|
|
dynamically loaded.
|
|
|
|
|
|
|
|
Did you already submit a Kivy application to the App store ?
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
2012-08-02 14:09:46 +00:00
|
|
|
Yes, check:
|
2012-05-10 19:32:48 +00:00
|
|
|
|
2012-08-02 14:09:46 +00:00
|
|
|
- `Defletouch on iTunes <http://itunes.apple.com/us/app/deflectouch/id505729681>`_,
|
|
|
|
- `ProcessCraft on iTunes <http://itunes.apple.com/us/app/processcraft/id526377075>`_
|