DEV Community

Cover image for Native iOS Game Development w/ Rust

Native iOS Game Development w/ Rust

Wade Zimmerman on September 01, 2022

My documented journey of exploring cross platform game development using purely Rust. Seriously. It's 100% Rust! Next article: Handling tap ev...
Collapse
 
marlon_klaus_4475911722a9 profile image
Marlon Klaus

Hello,
When I try this, I get the following error:
The request to open "com.marlonklaus.mytestgame" failed.
Do you have any idea? I hardcoded the bundle identifier and the app name, but Im not quite sure which bundle identifier I have to use.

Thank you in advance :)

Collapse
 
wadecodez profile image
Wade Zimmerman

Sounds like your app is making a request to the simulator but it's not going through. You probably just need to restart/delete your simulator. Which simulator are you using?

You can also try to use a different build target if you're using an older mac or different simulator. rustup target list will list out available build targets.

stackoverflow.com/questions/424519...

Collapse
 
daaitch profile image
Philipp Renoth

Hey, thanks for sharing. Do you have any experience bringing native controls like buttons to the screen? Is it possible?

Collapse
 
wadecodez profile image
Wade Zimmerman

Was just reading about this actually. My approach was to listen for touch events and do something either when a touch just started or when it was just pressed.

However, it doesn't feel very natural. I'm thinking it would be better to include a slight delay like debounce method but I haven't gotten that far yet.

bevy-cheatbook.github.io/input/tou...

Collapse
 
daaitch profile image
Philipp Renoth

Okay, so that wouldn't be Apple's AppKit as UI, but for example bevy_ui or another UI crate?

Thread Thread
 
wadecodez profile image
Wade Zimmerman

Don't quote me on this because I haven't done my research, but it sounds like GUI frameworks are bleeding edge for Rust. It looks like most libraries are just bindings to C. Looks like this is a good starting point. Also here is my Twitter

Collapse
 
elasehuang profile image
Elase Huang

Hey, thanks for sharing. It help me lot with migrating my bevy based game to ios platform. But i'm stucked in loading assets. Is it convenient to ask how you bundle assets into .app?🤔

Collapse
 
elasehuang profile image
Elase Huang

I have find the solution yet, add resources = ["assets"] worked for bevy assets system, but not work for image create, thanks although

Collapse
 
wadecodez profile image
Wade Zimmerman

I haven't tried loading assets into my iOS app yet, but I would try to compile to a desktop app first and see if the assets load there. If the assets load for a desktop build but not an iOS build, then I would inspect the .ipa archive folder to see if it contains an asset bundle, and if the plist in the archive points to the correct path.

You can use the tar command or you can change the .ipa extension to .zip and uncompress the files to see what's inside.

Are you getting any error messages when the images fail to load?

Collapse
 
nikolajevs86 profile image
P.Nik

Hi, I have followed the guide, but my app fails while trying to install itself by "xcrun simctl install booted {APP}".
The thrown error message is : domain=IXUserPresentableErrorDomain, code=4 and "This app needs to be updated by the developer to work on this version of iOS.".
Can someone advice how to fix this please?

Collapse
 
binchem profile image
Binchem Peng

Thank you for sharing, this is really great, there is no problem on ios, but I am stuck on android, do you have any experience to share?