Build a Feathers UI project as an iOS app

Feathers UI may be used to build mobile applications targeting Apple's iOS operating system (including iPadOS).

Prerequisites

In addition to the dependencies specified in the Feathers UI installation instructions, building an iOS application with Feathers UI has some additional requirements.

  • An Apple computer running macOS. iOS apps cannot be built on Windows or Linux.

  • Install Xcode from the macOS App Store.

    • Launch Xcode at least once to "install additional required components".

Build

To build for the ios target, run the following command.

openfl build ios

Use the -debug flag to create a build to include extra debugging information, including full stack traces when there's an exception or crash.

openfl build ios -debug

The build's output will be written to the bin/android/bin folder. The .apk file may be found in bin/android/bin/app/build/outputs/apk/debug (including release builds).

Your project.xml file may optionally specify an output folder different from bin.

<app path="Export"/>

In the example above, the output would be generated in Export/android/bin instead.

iOS Simulator

Add the -simulator flag to build your app for Xcode's device simulator on your development machine.

openfl build ios -simulator

To install the app in the iOS simulator, follow these steps.

  1. Launch Simulator.app.
  2. Select your desired device by opening the File menu, then Open Device.
  3. Wait a moment for the simulated device to start.
  4. Drag and drop your Feathers UI .app file from the Finder to the simulated device's home screen.
  5. Click the app icon to launch.

Troubleshooting

Error: Signing for "ProjectName" requires a development team. Select the development team in the Signing & Capabilities editor.

The signing options for iOS have not been specified in the OpenFL project.xml file.

One way to resolve this issue is to add your Team ID to your project.xml file. The Team ID is assigned by Apple, and it may be found in the Membership section of the Apple Developer Portal.

<certificate team-id="XXXXXXXX" />

Error: xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

Run the following command in a terminal to resolve this issue.

sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

App executable crashes without exception, and a try/catch around the line where it happens has no effect when targeting C++ for Android or iOS

Haxe's cpp target is stricter than other Haxe targets when you try to access a field or method on a null value. Instead of throwing an exception, a Haxe C++ app immediately crashes — with no way to recover, not even with try/catch. However, it is possible to enable a flag to force Haxe's C++ target to behave more like other targets. Add the following define to your OpenFL project.xml file, and then create a new build with the -clean command line option (or delete your output directory before building).

<haxedef name="HXCPP_CHECK_POINTER" />

Using HXCPP_CHECK_POINTER may add some overhead that could negatively affect performance. It may be a good idea to enable it temporarily for debugging purposes, fix the issue, and then disable it again.

Did you get some other error message that you don't understand?

Configuring OpenFL to build for native targets, like iOS or Android, can be a little tricky! Head over to either the Feathers UI community forum or the Feathers UI Discord. Explain which command you tried to run, be sure to mention that you are targeting ios, and post the error message (and any additional relevant output). Ideally, we can help you figure out a solution, and then we'll also add it to this troubleshooting section, so that everyone can benefit.