IPhone Development

Revision as of 21:10, 22 June 2009 by Manus (Talk | contribs) (Testing under the iPhone Simulator)

Construction.png Not Ready for Review: This Page is Under Development!

Requirements

To develop in Eiffel for the iPhone, you need:

  • a Mac running Mac OS X 10.5.7
  • the latest iPhone SDK 3.0 and the latest Xcode
  • the official EiffelStudio 6.4 release for the Mac

Getting ready

The iPhone development requires 2 targets and each target has its own value for the environment variable ISE_PLATFORM:

  • iphone-x86: when testing under the iPhone simulator
  • iphone-arm: when compiling for the actual iPhone device.

Every piece of C code has to be compiled for both targets. Therefore repeat the compilation instructions below twice, one for each target.

Preparing the delivery

Under $ISE_EIFFEL/studio/spec, replicate the macosx-x86 into iphone-x86 and iphone-arm. Do the same in $ISE_EIFFEL/precomp/spec and $ISE_EIFFEL/studio/config.

Compiling

Then you need to check out the source code. The easiest is to create a directory 65dev, go in this directory and then checkout the source code by doing:

svn co https://svn.eiffel.com/eiffelstudio/trunk/Src .

Then set the environment variable ISE_LIBRARY and EIFFEL_SRC to the 65dev directory above.

The Eiffel C runtime

Set ISE_PLATFORM accordingly and in $EIFFEL_SRC/C, type:

./quick_configure

Once compiled do:

cp config.sh $ISE_EIFFEL/studio/spec/$ISE_PLATFORM/include
cd run-time
cp *.h $ISE_EIFFEL/studio/spec/$ISE_PLATFORM/include/
cp lib* $ISE_EIFFEL/studio/spec/$ISE_PLATFORM/lib/

The Eiffel C libraries

You need to compile some C code. Go in the $ISE_LIBRARY/experimental/library/objc_base/Clib and type

finish_freezing -library

then go in $ISE_LIBRARY/experimental/library/iPhone/Clib and type again

finish_freezing -library

Compiling your first iPhone application

Compile the project in $ISE_LIBRARY/examples/iphone/basic. Once done you have a binary called `basic'.

Testing under the iPhone Simulator

For the moment, create a simple iPhone application with Xcode, then compile it for the simulator. Once done, you can type:

cd ~/Library/Application\ Support/iPhone\ Simulator/User/Applications

and find the directory corresponding to the application you just created. Once done go into that directory and into the Application bundle. Delete the binary and create a symbolic link to the application compiled via EiffelStudio in the W_code directory.

Now to test your application, you can simply launch the simulator and start your application from there. The simulator is located at:

/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications

Testing under the iPhone Device