Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building/Testing on iOS #17

Open
tommywalkie opened this issue May 18, 2020 · 7 comments
Open

Building/Testing on iOS #17

tommywalkie opened this issue May 18, 2020 · 7 comments
Labels
cicd For any Github Actions related issues help wanted Extra attention is needed ios For any iOS related issues
Milestone

Comments

@tommywalkie
Copy link
Owner

tommywalkie commented May 18, 2020

📣 UPDATE 1 (19/05/2020)

Actually successfully compiled Rust source and exported for iOS in 441b1a4, using a fake Apple Team ID 123456789.

Of course there are big caveats :

  • Output size : ~120MB (not sure if this is an expected file size) => According to Godot docs, this looks fine.
  • Only the one guy with an Apple Team ID 123456789 will be able to test the app, unless I decide to enroll for Apple Developer Program for (99 USD/yr, it apparently has a free tier, but it still requires to own a registered Apple trusted device) => Building/Testing on iOS #17 (comment)

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 godot-rust/gdnative#285, it seems like building a GDNative Rust based game for iOS is possible with these notable steps :

  • Install proper Rust toolchains
    • 64-bit (top priority) — aarch64-apple-ios and x86_64-apple-ios
    • 32-bit — armv7-apple-ios and i386-apple-ios
  • Check if MacOS based runner has llvm-config (iOS build failing  godot-rust/gdnative#285 (comment))
  • Install and generate .a universal libraries with cargo-lipo
  • Setting something in XCode ?
  • Export for iOS with Godot Engine

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 tommywalkie added help wanted Extra attention is needed ios For any iOS related issues cicd For any Github Actions related issues labels May 18, 2020
@tommywalkie
Copy link
Owner Author

Successfully built static library *.a with aarch64-apple-ios toolchain and cargo-lipo in 483f690.

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
Copy link
Owner Author

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
Copy link

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
Copy link

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
Copy link
Owner Author

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
Copy link
Owner Author

Updated issue summary to reflect recent results in 441b1a4 and encountered caveats.

@paytonrules
Copy link

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

  • After exporting to iOS and trying to build, the first error was that my godot lib could not be found. I had to "Re-add" that library even though it was present in order to get it to build. Weird because the path looked right in XCode.
  • I then had to change the Debug Information in the workspace to use DWARF not DWARF with sys, otherwise the build would crash.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cicd For any Github Actions related issues help wanted Extra attention is needed ios For any iOS related issues
Projects
None yet
Development

No branches or pull requests

3 participants