Sign in Join
Wiki copytemporary

iPhone Laz Extension

(iOS only)

About

iPhone Laz extension is Lazarus IDE extension that's designed to simplify iPhone applications development.

Before you use the extension, it's recommended to learn the page about iPhone/iPod development.

The extension does NOT provide another LCL WidgetSet (like Carbon or Cocoa) nor requires to use any.

Author

Dmitry 'skalogryz' Boyarintsev

email: skalogryz dot lists at gmail dot com

License

modified LGPL (same as the FPC RTL and the Lazarus LCL). You can contact the author if the modified LGPL doesn't work with your project licensing.

Download

The latest stable release can be found at svn:

svn co https://lazarus-ccr.svn.sourceforge.net/svnroot/lazarus-ccr/components/iphonelazext

Change Log

Dependencies / System Requirements

Status: Beta

Known Issues:

pascal
  Application.Title := 'MyApp';

It must be deleted manually

To do:

Installation

In order to develop for iPhone or iPod, you'll need arm FPC compiler with rtl and packages installed in the system. There're 2 ways to do it: built manually via SVN or installed from a special FPC arm package. Both ways are described here.

You don't need to install ARM compiler or packages, if you're planning to use iPhone simulator only.

How to use

Common usage

iPhone Simulator

The installation is always performed then you try to build the project.

iPhone simulator apps require special environment, created by the simulator or they will fail with "trace error" if run in pure OSX. To make the simulator Run everytime you're running the application, select in menu "Run->Run parameters..." check "Use launching application" put there

'/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone Simulator.app/Contents/MacOS/iPhone Simulator'

Note: the location of iPhone simulator.app may vary, depending on the iPhone SDK installation path.

It's not required, but you'll need to launch iPhoneSim manually otherwise.

It's possible, that iPhone sim also starts the required application (as Xcode does), but this possibility is undocumented by Apple. You can use it on your own risk. Please refer to http://github.com/jhaynie/iphonesim

Project to Xcode

There's not way to install an application to iPhone, but using Xcode (or purchasing it via iTunes). (Jailbreaks have their own way, not used by the package). The package provides an utility to generate an Xcode project from Lazarus project.

Note:

Examples

The extension also includes a few sample projects. (see examples dir at the iphonelazext directory)

Hello World

The sample requires a objective-p compiler with any version of iPhoneAll unit.

The example has been written using iPhoneAll of this version (https://github.com/genericptr/iOS_8_0))

The intent of the sample is to show how to go from Lazarus project to Xcode project.

0. Install iPhone Laz Extension. Make sure you've FPC cross-compiler prepared. It's better to have it ready for all iOS targets (i386-iphonesim, x86_64-iphonesim, arm-darwin, aarch64-darwin). The compilation script will build both 32 and 64-bit targets.

1. The example project in Lazarus

2. Open Project Options

  1. Compiler Options -> "Paths": specify where iPhoneAll unit is located at "Other unit files (-Fu)"
  1. Make sure -dIPHONEALL is present in "Custom Options" (thought it might not be needed for the version of iPhoneAll you're using)
  1. in "iPhone Specific" section check the box "is iPhone application project"
  1. Close the dialog by hitting "OK"

3. in Project menu press "Update Xcode project"

4. At the directory with the lazarus project a new "xcode" directory will created. Within the directory there should be "ihelloworld.xcodeproj" generated. Double-click on the bundle so Xcode will start.

5. In Xcode. make sure you've a simulator selected as a target device. Hit "Play" icon (top-left side of the window) ( or through menu Product -> Run )

  1. This should start compilation of the project. If no issues would be detected, the simulator will start. As soon as its booted Xcode will install the application and run it.

6. An actual device. Plug your device via USB.

  1. In "General" tab you should see a "warning sign" with "No identity or provisioning profile". "Fix issue" button should be availabe.
  1. Hit the button. The Xcode should get you a certificate, so you'd be able to run the application on your device.
  1. Select the device as run target (top-left side of the Xcode window).
  1. Clear the project (Product -> Clear)
  1. Run the project (Product -> Run)

The result would look like:

iArkanoid

Written from scratch simple arkanoid game UIKit and GoreGraphics games for iPhone/iPod.


From the Free Pascal wiki, page "iPhone Laz Extension", as it stood on 2019-12-22 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.

Revision 1, last changed by WikiArchive .

Talk about this page

Nobody has opened a bench for this page yet. Sign in to open one.