Building for iOS Simulator, but linking in object file built for iOS

Hello.

I found similar discussion on this subject but this probably something different so I thought to ask separately.

I was try building sample project provided by FeathersUI/Openfl on iOS.

I ran following command to build the project for iOS-simulator:
% haxelib run lime build ios -simulator

This went well and generates Xcode project under “bin/iOS” directory along with its .xcodeproj file. I open that on Xcode 16.1.

While try running the project on iOS simulator, I received following error:

Building for 'iOS-simulator', but linking in object file (/Users/devsena/Desktop/components-explorer/bin/ios/Components/lib/arm64/liblime.a[2](d6db1c91_ColorMatrix.o)) built for 'iOS'

After some StackOverflow, I change this in project’s Build Settings. That removes the error for me:
image

Now when I tries to run the project on iOS simulator, it throws me following error and never installs on simulator:

For reference, following are the versions I’m using:

  • Lime 8.2.1
  • Haxe 4.2.5
  • Openfl 9.4.0

Any guidance to resolves this problem, or if there is any other way to produce for mobile platform, please let me know. Thanks!

Did you build iOS ios without -simulator previously? If so, you might need to add -clean to ensure that it’s not using object files for a real device instead of the simulator.

I’m currently using macOS Sequoia 15.3, Xcode 16.2 with iOS 18.2, Haxe 4.3.6, OpenFL 9.3.4, and Lime 8.2.2. I was able to get lime test ios -simulator -clean to work on my machine with the same Feathers UI components-explorer project. No changes to the Xcode project required. The one quirk I saw is that the simulator launched, but my app didn’t open. But I ran the command again (without -clean the second time, just to avoid the long C++ build times), and it launched successfully in the already-open simulator.

1 Like

Thank you very much, @joshtynjala ! That was a big help.

But what’s are the process to sign a Haxe/Openfl application with certificate/provisioning-profile and then submit to App Store?

Although the command you suggested works (and manually install the .ipa file in simulator) - but the generated Xcode project turns still faulty.

I wanted to use the generated Xcode project to -

  1. Choose correct certificate and provisioning-profile
  2. Build .xcarchive file to facilitate with Xcode upload process to App-Store/Test-Flight

While I tried to run the generated Xcode project, I continue to see the same problem described in the original issue. I was wondering if you able to run the generated Xcode project at your end or not.

I’m not sure that I’ve tried running the generated Xcode project. I’ve never had a reason to need to do that yet.

See Lime’s iOS: Code Signing documentation.

For testing on a real device (without -simulator), I have successfully specified team-id only. I haven’t released an OpenFL app on the App Store, so I’m not sure if team-id is all you need for that or not. Maybe someone can chime in about that, if they’ve released any apps.

Regardless, we also have options for specifying provisioning-profile and identity. There does not appear to be a way to specify a certificate file for iOS. Only the name of a developer identity from the Keychain.

1 Like

I confirm the problem. However, with or without having -clean command and ran multiple times, the app not automatically installs to running simulator - if that what is suppose to be.

I even tried keep run both iPhone and iPad simulators at the same time, but I see upon completion one of the simulator get focused but nothing installs automatically. I requires to drag-n-drop the app file into simulator manually.

You mentioned that you were using Lime 8.2.1. There was an issue where we sometimes tried to install apps in iOS simulators that were considered “unavailable”. That was fixed in 8.2.2.

1 Like

Thank you @joshtynjala , then I should considering to update Lime.

I was also wondering how to install on device during local tests. Can you please advise on that too (?)

I’m not sure that I understand exactly what you are asking about.

So Lime produced an .app file. If I want to install that on my physical iOS device, can we do that (?) Sorry, if I’m blurring my thoughts…

lime test ios should install the app on a physical device automatically, if the device is connected to your computer.

Alternatively, you can open Xcode, go to WindowDevices and Simulators to find your physical device. You should be able to drag and drop the .app file into that window to install it on the device.

Thank you @joshtynjala .

Something not seems to be right though, when I tried to give this a test.
I updated Lime to 8.2.2. I connected my iPad device and also ensured that it is detected by the OS.

Upon running lime test ios it failed to installs reporting “No device connected”.

At the same time, if I ran xcrun xctrace list devices, I can see my device in connected list:

I checked my project has deployment target to 12, when my device was iOS v16+:
<config:ios deployment="12.0" />

Trying opening Xcode’s Devices and Simulators before running lime test ios.

For reference, we currently use the following command to find a connected iOS device:

xcrun devicectl list devices --hide-default-columns --columns Identifier --filter "Platform == 'iOS' AND State == 'connected'"

The command seems to have some problem then, @joshtynjala . I confirm while running the command in command-line, it returns “No device found.” message.

At the same time, I can directly run on device using Xcode.

I wonder if the command that’s using by Lime during the process, needs some adjustment.

For references I’m using,

  • iPad (5th gen)
  • iPadOS (not iOS if that makes any difference) v.16.7.10

I tried to run only this, but that also returned me no device found message:
xcrun devicectl list devices

Please confirm that you tried opening the Devices and Simulators window in Xcode before trying to install on the device. I found that the xcrun devicectl list devices command does not list my connected iPhone unless I’ve opened that window.

@joshtynjala I confirm in Devices and Simulators, my device well detected and shown but the xcrun command. I re-confirm that I can install to device correctly using Xcode, without any trouble.

I created a separate issue to discuss the device detection problem: