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

Ios support #61

Merged
merged 36 commits into from
Jul 26, 2023
Merged

Ios support #61

merged 36 commits into from
Jul 26, 2023

Conversation

NiklasEi
Copy link
Owner

Resolves #30

Copy link
Contributor

@CleanCut CleanCut left a comment

Choose a reason for hiding this comment

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

It looks like it almost worked for me. After installing Xcode, the iPhone simulator, and the required toolchains, a make run inside the mobile/ directory manages to build, but then dies trying to launch a simulator.

[snip]
    /usr/bin/touch -c /Users/nathan/rust/bevy_game_template/mobile/build/Build/Products/Debug-iphoneos/mobile.app

** BUILD SUCCEEDED **

xcrun simctl boot 3rd || true
Invalid device or device pair: 3rd
xcrun simctl install 3rd build/Build/Products/Debug-iphonesimulator/mobile.app
Invalid device: 3rd
make: *** [install] Error 148

README.md Outdated Show resolved Hide resolved
mobile/Makefile Outdated Show resolved Hide resolved
@NiklasEi
Copy link
Owner Author

NiklasEi commented Jul 21, 2023

I pushed the WIP manifest.yaml to switch from cargo-apk/Makefile and co. to xbuild. It currently requires my own xbuild fork though and doesn't work for iOS yet.

  1. cargo install --git https://github.com/NiklasEi/xbuild
  2. Install everything so that x doctor is happy
  3. Run x devices, pick a device and
  4. Run x run --device <device> in mobile

@CleanCut
Copy link
Contributor

I'm happy to test for iOS again once you have it working for yourself.

@NiklasEi
Copy link
Owner Author

NiklasEi commented Jul 24, 2023

I now see everything in my simulator. Apparently iOS requires WindowMode::BorderlessFullscreen.

I've also been working on extending the release flow for android and iOS builds. Since I don't have access to an iPhone at the moment, maybe someone could check a build for me?
Debug: https://github.com/NiklasEi/bevy_game_template/releases/download/ios_support/bevy_game_v0.1.0-test.12_ios.ipa
Attempt at release config: https://github.com/NiklasEi/bevy_game_template/releases/download/ios_support/bevy_game_v0.1.0-test.14_ios.ipa

xbuild still doesn't work for iOS, because I don't know how to propperly configure the executable.

@CleanCut
Copy link
Contributor

I should be able to test this later today.

@CleanCut
Copy link
Contributor

CleanCut commented Jul 26, 2023

I was able to "install" both .ipa files by dragging them onto my iPhone's finder window, but trying to run them failed with the same error for both:

Unable To Install "mobile"
This app cannot be installed because
its integrity could not be verified.

I'm not super surprised -- because I don't know of any ad-hoc way of installing someone else's app without at least signing it with your own development certificate. Or going through the app store with testflight or an official release. But then, I am no iOS expert, maybe I just don't know what I'm supposed to do to make it work.

I am able to do make xcodebuild-iphone, make xcodebuild-iphone-release, and xcodebuild-archive-release which complete successfully.

make run works† -- but I usually have to manually launch Simulator.app in order to see the simulator UI, which is weird, because it popped up by itself at least once earlier, but it no longer seems to do that for me. 🤷🏻‍♂️

† As long as I keep adding in my Makefile patch that I suggested to fix the device id scraping

@NiklasEi
Copy link
Owner Author

Thank you for testing again. I would have thought that there is a way to trust an unsigned app and install it anyways.
But then the new workflow for automatic exporting/signing/uploading I have been trying to build is more important than I thought.
Apple really doesn't make this easy...

@NiklasEi
Copy link
Owner Author

After a lot of trial and error, the new workflow to prepare and upload an ipa to app store connect finally works 🥳 . A friend of mine has verified via TestFlight that the build runs fine (although it doesn't seem to have any audio, but that a separate issue I guess).
The workflow also uploads the signed ipa to a release. This one should no longer cause the This app cannot be installed because its integrity could not be verified. error.

@NiklasEi NiklasEi merged commit 27ee861 into main Jul 26, 2023
10 checks passed
@CleanCut
Copy link
Contributor

I forgot to mention in my last comment that audio had stopped working.

The workflow also uploads the signed ipa to a release. This one should no longer cause the This app cannot be installed because its integrity could not be verified. error.

Unfortunately, I still get the same error. 😕

@NiklasEi NiklasEi deleted the ios_support branch July 27, 2023 07:09
github-merge-queue bot pushed a commit to bevyengine/bevy that referenced this pull request Oct 8, 2023
# Objective

- Make sure that users can "just run" the mobile example
- Device descriptions like `iPhone SE (3rd generation)
(F647334F-D7C1-4BD6-9B5F-0E3D9713C02B) (Shutdown)` currently fail
([issue
found](NiklasEi/bevy_game_template#61 (comment))
by @CleanCut)

## Solution

- Improve the script that grabs the device UUID from the device list
regnarock pushed a commit to regnarock/bevy that referenced this pull request Oct 13, 2023
# Objective

- Make sure that users can "just run" the mobile example
- Device descriptions like `iPhone SE (3rd generation)
(F647334F-D7C1-4BD6-9B5F-0E3D9713C02B) (Shutdown)` currently fail
([issue
found](NiklasEi/bevy_game_template#61 (comment))
by @CleanCut)

## Solution

- Improve the script that grabs the device UUID from the device list
ameknite pushed a commit to ameknite/bevy that referenced this pull request Nov 6, 2023
# Objective

- Make sure that users can "just run" the mobile example
- Device descriptions like `iPhone SE (3rd generation)
(F647334F-D7C1-4BD6-9B5F-0E3D9713C02B) (Shutdown)` currently fail
([issue
found](NiklasEi/bevy_game_template#61 (comment))
by @CleanCut)

## Solution

- Improve the script that grabs the device UUID from the device list
rdrpenguin04 pushed a commit to rdrpenguin04/bevy that referenced this pull request Jan 9, 2024
# Objective

- Make sure that users can "just run" the mobile example
- Device descriptions like `iPhone SE (3rd generation)
(F647334F-D7C1-4BD6-9B5F-0E3D9713C02B) (Shutdown)` currently fail
([issue
found](NiklasEi/bevy_game_template#61 (comment))
by @CleanCut)

## Solution

- Improve the script that grabs the device UUID from the device list
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.

[Feature Request] iOS & Android template
2 participants