maui and iOs 18

J Allen 50 Reputation points
2024-09-13T23:14:25.62+00:00

My apologies if I am missing something simple here.

I submitted an updated maui blazor hybrid app to apple for review and they rejected it because it launched to a blank white screen when they tested on a device running a beta version of iOs18. Looking at other posts (https://github.com/dotnet/maui/issues/23390) it looks like I needed to update my webview.maui ref to 8.0.80 which I have done. So it is my understanding that in order to get the iOs18 simulators I would need Xcode 16 RC. So I updated my macOS to Sonoma and updated my Xcode to 16. I then updated my VS to Version 17.11.3. I am guessing that VS Version 17.11.3 doesn't support Xcode 16 because now when I pair my laptop to my mac I have no simulators because of a "Xcode mismatch error". So how do I build my app to an iOs 18 simulator from visual studio to test it before resubmitting to apple?

Thanks,

Jeremy

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,424 questions
{count} votes

Accepted answer
  1. Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 30,746 Reputation points Microsoft Vendor
    2024-09-16T05:50:46.5233333+00:00

    Hello,

    Apple published the Xcode beta6, but the stable version of Xcode16 has not been released in AppStore yet. (Xcode 16 Release Candidate)

    Preview version is not supported on Q&A, you can refer to the GitHub issue to use preview Xcode: Figure out how to publish Xcode preview packages · Issue #18343 · xamarin/xamarin-macios (github.com)

    If you have any other issues about the Xcode16 and iOS18 support, please rise an issue at GitHub.

    Best Regards,

    Wenyan Zhang


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


4 additional answers

Sort by: Most helpful
  1. Bruce (SqlWork.com) 64,486 Reputation points
    2024-09-16T16:49:06.09+00:00

    instead of loading the beta, you can just download the emulators with Xcode. see:

    https://developer.apple.com/documentation/xcode/installing-additional-simulator-runtimes

    simulator download site:

    https://developer.apple.com/download/all/?q=Simulator%20Runtime

    note: as soon as the release versions are available you will want to download and test again. it will be a while before Maui supports Xcode 16, and you must stick with Xcode 15.4 (my guess would be that the Maui 9 workload will be required to support Xcode 16 & iOS 18).

    1 person found this answer helpful.

  2. J Allen 50 Reputation points
    2024-09-17T22:20:38.39+00:00

    Hi @Pascal Pereira

    Here is what worked for me. I hope it may help you too.

    1. I reinstalled Xcode 15.4 (As @Bruce (SqlWork.com) said, we don't need the new Xcode to get the iOs 18 simulators and we also don't need to build our apps with the new Xocde for the app to run on iOs 18. What we really need is the fix in step 5).
    2. I then installed the iOs 18 simulators - Xcode 15.4 > Settings > Platforms.
    3. Rebooted my PC and my MAC
    4. Paired Visual Studio to my MAC
    5. Updated the maui reference in my mobile project file to 8.0.80 as mentioned here https://github.com/dotnet/maui/issues/23390
    6. Built to the new iOs 18 simulators - They all worked.
    7. Submitted a new TestFlight build for users with iOs 18 installed to test it - It worked on all of their devices.
    8. Submitted the app for review and released the new build to the App Store.

    Thanks,

    Jeremy

    1 person found this answer helpful.

  3. J Allen 50 Reputation points
    2024-09-14T04:17:23.58+00:00

    I went back to Xcode version 15.4 and now have the iOs18 simulators and I am able to build to them after pairing to my mac. I think I could have probably just installed the iOs18 simulators through Xcode all along. I think I will still need to get an actual device running the latest beta of iOs18 to truly test what Apple will use to test with when they review the app.

    0 comments No comments

  4. Pascal Pereira 0 Reputation points
    2024-09-19T16:31:48.91+00:00

    OK... so after losing copious amounts of hair and aggravating my caffeine addiction problem... I've found the problem... To anyone else coming across this... here was the issue:

    Early on this issue was found:

    https://github.com/dotnet/maui/issues/23390

    I implemented the suggestion

            // Set this switch to use the LEGACY behavior of always using 0.0.0.0 to host BlazorWebView
    
            AppContext.SetSwitch("BlazorWebView.AppHostAddressAlways0000", true);
    ```some point later... the fix got put into maui here:
    
    [https://github.com/dotnet/maui/pull/23906]()
    
    but I didn't notice and now that one line of code clashed with new Maui lib and voila.... my users were toast.
    
    Thanks [@](/users/na/?userid=6949b03b-c8c3-429b-98e4-0091fb686041)for your responses and help throughout!!
    
    
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.