Sideloading OpenFL onto iOS

Hello - lately I have been toying with OpenFL. I want to use it for the classes I teach at an elementary school. It is quite good. And these forums are helpful.

I am working on a project for the iPad and wanted to try using OpenFL with Xcode 7’s new “sideloading” approach. It is working well for me - though there were a lot of stubborn points along the way.

I have written up all the details here. Perhaps this is useful to others. Looking forward to my time with OpenFL. Thank you!

Thanks for this!

We try to use a generic provisioning profile by default. The key is that you need to first set up Xcode, and be sure that Xcode will allow you access to your device, first, before you are able to use it with openfl test ios automatically from the terminal.

After setting things up, can you openfl create DisplayingABitmap && openfl test DisplayingABitmap ios? Does that find the provisioning profile for you?

The most recent update of Lime includes changes to fix the ENABLE_BITCODE setting, so an OS version of < 6 will set it to NO, and >= 6 will set it to YES by default. This should get us past the compile errors, I believe.

Please let me know :slight_smile:

Tell me what you mean by a generic provisioning profile. I’m guessing you mean without any Apple account at all?

I do mention the recent ENABLE_BITCODE fix - not by name, but that the error is fixed in lime 2.4.8. The only reason this point is mentioned is just to encourage the reader to have an updated OpenFL install. Mine was a few weeks old.

The tools use “iPhone Developer” as the certificate identity by default. This should prompt Xcode to look for a compatible provisioning profile – if none is available on the system, there’s nothing that can be done (by Apple’s design :frowning: ) but if one has been set up already, this should allow an OpenFL project to sign and build without having to specify a project-specific profile.

In theory :wink:

Okay - so now that I have a working provisioning profile, I shouldn’t have to manually open the project in Xcode? I don’t think that’s working for me - I still get the missing provisioning profile problem (running openfl test ios) unless I load the xcodeproj file and specifically assign a team profile. But this might be different since I’m using the profile for sideloading rather than an actual developer account.

I totally feel that these are hoops made to jump through by Apple - you’ve done a great job. :grin:

I think the default (generic) certificate identity names are “iPhone Developer” or “iPhone Distribution”, I wonder if there is a generic certificate identity name for the new sideloading profile?

You should be able to use <certificate identity="iPhone Developer" /> in your project XML. This one isn’t working with the free profile accounts, but would you mind looking to see if you can find an identity name that does work on your system? That may give us clues to finding a generic one :slight_smile:

I can confirm that the this works for me.

Ok - so I believe the reason OpenFL doesn’t work automatically with the sideloading certificate is because I can’t seem to make a wildcard bundle id (app id?) without a developer account. In fact, I think the certificate I’m using is a real developer cert tied to my account - I just am not given access to the provisioning profile management stuff on developer.apple.com. This is why, at the very least, I find myself needing to use “Fix Issue” through Xcode - the issue is not that the generic profile isn’t working - the issue is that any new unique bundle id that I attempt to sign isn’t assigned to the profile yet. Without access to the provisioning area, “Fix Issue” is the only way I can find of to add the bundle id to my account.

OpenFL works great after that - I can subsequently rebuild again and again without needing to hit up Xcode again.

Of course another way to work around this is to reuse the same bundle id over and over again. I just assumed this might cause issues if I want to deploy two apps on the same device that share a bundle id.

I am very inexperienced with this stuff, though, so please chasten me if I’m just not understanding this. :stuck_out_tongue_winking_eye: I just have no need of a developer account - my projects are just experiments to use in my classes, no need to release to the app store.

We might be hitting edge cases of the roll out of this feature – Apple might realize (hopefully!?) that people are having problems and polish this a bit more

Then again, I had hoped they would release a “deploy to device” feature that did not require manual push-buttons in Xcode, but no, Apple has never delivered that. The whole ios-deploy/ios-sim system we use is third-party hacking :slight_smile:

Good point. Xcode is still a beta. Thanks for all the responses. Truly appreciate you taking the time! :relieved: