Skip to content

iOS build script(better version of #151)#152

Open
frederik-uni wants to merge 10 commits into
emilk:mainfrom
frederik-uni:ios-build-script
Open

iOS build script(better version of #151)#152
frederik-uni wants to merge 10 commits into
emilk:mainfrom
frederik-uni:ios-build-script

Conversation

@frederik-uni

@frederik-uni frederik-uni commented Aug 4, 2024

Copy link
Copy Markdown

simple wrapper around, building the project with cargo-bundle & running it with xcrun commands. the toolchains are set by default to aarch64 & can be modified with the --x86 flag or --sim for the simulator. creating a ipa from a .app file is quite easy(rename app folder to Payload and zip it) is also automated

@frederik-uni

Copy link
Copy Markdown
Author

eframe 0.28.2 is required or ([patch.crates-io] & remove web-sys.version = ">= 0.3.4, < 0.3.70")

@emilk emilk left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool - thank you!

Comment thread ios-cargo
Comment thread ios-cargo
@@ -0,0 +1,180 @@
#!/usr/bin/env python3

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file should have a .py file extension. Maybe it should also be called build-ios? But the current name is fine too.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I decided not to use the .py extension so it can be put into the bin folder & used as command

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it only uses builtin libs

@emilk

emilk commented Sep 26, 2024

Copy link
Copy Markdown
Owner

@lucasmerlin you've done some iOS work, maybe you wanna take a quick look? 🙏

@lucasmerlin

Copy link
Copy Markdown
Collaborator

Look really cool! Is there any reason you decided not to use cargo-mobile?

@frederik-uni

Copy link
Copy Markdown
Author

I don't want to change the project to run on a iOS target. cargo-mobile compiles it as a static lib and imports it into a swift app. My goal was to have a script that would need to be installed once and can run any existing egui project without modifying it. The only thing that needs to be added is a id to the cargo.toml.

@lucasmerlin

Copy link
Copy Markdown
Collaborator

Ah, I see, that makes sense!

@frederik-uni

frederik-uni commented Oct 1, 2024

Copy link
Copy Markdown
Author

this should work for most Egui/eframe projects with a version > 28.1 with "wgpu" as rendering backend

Comment thread README.md Outdated
@hacknus

hacknus commented Apr 18, 2025

Copy link
Copy Markdown

Hi, thanks a lot, this looks really nice! I think this line here needs to be changed:

def parse_cargo_toml():
    with open('Cargo.toml', 'rb') as f:
        cargo_toml = tomllib.load(f)
    # here we need to get the name (at least if it is set here, we should probably use ["package"]["name"] as a fallback somehow
    app_name = cargo_toml['package']['metadata']['bundle']['name']
    app_id = cargo_toml['package']['metadata']['bundle']['identifier']
    return app_name, app_id

Can this be merged after that? I see there are some conflicts, probably just the versions, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants