tommywalkie / sample-godot-rust-app

Sample CI powered multi-platform Rust/GDNative based boilerplate project
MIT License
25 stars 1 forks source link

Building/Testing on iOS #17

Open tommywalkie opened 4 years ago

tommywalkie commented 4 years ago

πŸ“£ UPDATE 1 (19/05/2020)

Actually successfully compiled Rust source and exported for iOS in https://github.com/tommywalkie/sample-godot-rust-app/commit/441b1a4f725e1cf534ac16f79295b955e62617d6, using a fake Apple Team ID 123456789.

Of course there are big caveats :

You get the idea, to be able to confirm the CI setup is OK "as is", only an Apple Developer Program subscriber will be able to help.


πŸ’¬ Original issue

This will be the next targeted platform, and maybe the hardest one to support. Unfortunately, I don't have any iOS device to test the final product.

Following the conversation on https://github.com/GodotNativeTools/godot-rust/issues/285, it seems like building a GDNative Rust based game for iOS is possible with these notable steps :

If by any chance you are an Apple Developer Program subscriber and are able to try building and exporting sample-godot-rust-app for iOS, please comment here if it worked / additional steps / encountered issues.

tommywalkie commented 4 years ago

Successfully built static library *.a with aarch64-apple-ios toolchain and cargo-lipo in https://github.com/tommywalkie/sample-godot-rust-app/commit/483f6903b087670437d48a105a9ae50fa6561f78.

The next part is exporting via Godot, which requires a few fields. image

These fields can be found in export_presets.cfg.

application/app_store_team_id=""
application/identifier="com.example.game"
required_icons/iphone_120x120=""
required_icons/ipad_76x76=""
required_icons/app_store_1024x1024=""

Looks like iOS based GDNative libraries can be linked to a .gdnlib file using these fields :

[entry]
iOS.armv7="..."
iOS.arm64="..."

[dependencies]
iOS.armv7=[  ]
iOS.arm64=[  ]
tommywalkie commented 4 years ago

Apple Team ID can be apparently found in Apple account which needs to be upgraded into Apple Developer account, by enrolling into Apple Developer Program and setting up two-factor authentication which actually requires registering an Apple trusted device.

Will I need a trusted device dedicated to my Apple Developer account if I enable two-factor authentication? No. You’ll need to use a trusted device to enable two-factor authentication for the first time. However, you can use the same trusted device for multiple Apple IDs that are enabled for two-factor authentication. Additionally, if you do not have access to your trusted device, you can get your verification code via SMS or phone call. When possible, you should use a trusted device to increase security and streamline the process.

TL;DR : No Apple trusted device, no Apple Team ID. Nice πŸ˜„

Filius-Patris commented 4 years ago

If that were the problem... An Apple Developer Account costs about 120 USD yearly.

And even if you were able to export to an iOS app archive, you can only install it on an iOS device associated with this Apple ID, else you'd have to distribute it through the app store.

I would say iOS CI is only useful coupled with CD in a real situation.

Filius-Patris commented 4 years ago

Oh, and the Apple trusted device is IIRC not needed, you can get in contact with the support and they'll enable you to use SMS. At least I could.

tommywalkie commented 4 years ago

If that were the problem... An Apple Developer Account costs about 120 USD yearly. And even if you were able to export to an iOS app archive, you can only install it on an iOS device associated with this Apple ID, else you'd have to distribute it through the app store.

@Filius-Patris Ohh this is critical level information ! πŸ‘€ I didn't even notice there was a paywall, maybe because I couldn't pass the requirements step.

Pricing The Apple Developer Program annual fee is 99 USD and the Apple Developer Enterprise Program annual fee is 299 USD, in local currency where available. Prices may vary by region and are listed in local currency during the enrollment process.

tommywalkie commented 4 years ago

Updated issue summary to reflect recent results in https://github.com/tommywalkie/sample-godot-rust-app/commit/441b1a4f725e1cf534ac16f79295b955e62617d6 and encountered caveats.

paytonrules commented 4 years ago

A couple caveats I ran into while building for iOS today.

I believe both of these errors are actually related to the Godot export tool, not godot-rust, but I suspect people google searching will find this issue first. At least if they are using rust like me.