maui icon indicating copy to clipboard operation
maui copied to clipboard

Slow build -> deploy on iOS

Open Inrego opened this issue 1 year ago • 9 comments

Description

The build process of iOS apps is very slow. Almost a minute (55 seconds) until first page is shown on physical device. Especially the build seems to take up much time, clocking in at around 40 seconds.

I'm deploying to a physical device that is connected by cable to the Mac.

Here are the specs of the Mac:

image

I tried the same on Xamarin.Forms, where the same process takes 45 seconds, so a bit faster but also tedious.

Such a long cycle to redeploy simple changes in my code makes it very tedious to develop on iOS. And no, I'm not using Hot Reload, because SkiaSharp doesn't work on iOS with Hot Reload.

Steps to Reproduce

  1. Create new .NET MAUI app from template (.NET 7)
  2. Set up connection to Mac
  3. Set up automatic provisioning
  4. Plug physical device into Mac
  5. Deploy app to device
  6. Stop app
  7. Make small change in code
  8. Deploy app again

Link to public reproduction project repository

N/A

Version with bug

Unknown/Other (please specify)

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

iPadOS 13.6.1

Did you find any workaround?

No response

Relevant log output

No response

Inrego avatar Apr 13 '23 11:04 Inrego

55 seconds? You're lucky, here it takes 5 minutes (same setup as you Visual Studio connect to MacbookPro, which has a physical iPhone connected via cable)

TomDacquinDMS avatar Apr 13 '23 14:04 TomDacquinDMS

Have you tried building and deploying a iOS app from Xcode with that setup to see how much faster it is?

drasticactions avatar Apr 14 '23 08:04 drasticactions

Hi @Inrego. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

ghost avatar Apr 18 '23 18:04 ghost

Have you tried building and deploying a iOS app from Xcode with that setup to see how much faster it is?

I just tried that. It was around 6 seconds.

Inrego avatar Apr 19 '23 08:04 Inrego

Also, I want to specify a bit: I'm developing in Visual Studio on Windows with connection to a Mac Mini on my desk. The timings I've done are not for first build, which I can understand would take longer. It's for "incremental" builds, where I'm just changing a single character in the UI and then hitting F5. All timings have been done on the project template which is created automatically when creating a new .NET MAUI app project.

I just tried a .NET MAUI app directly on the mac with Visual Studio for Mac, and it took just under 30 seconds.

So to recap:

Windows -> Mac: 55 seconds Directly on Mac: 30 seconds Swift Project in Xcode: 6 seconds

But yeah.. it's a pain to develop for iOS with .NET MAUI, when you have to wait a minute every time you changed something.

Inrego avatar Apr 19 '23 08:04 Inrego

I have a Mac Mini taking at least 40 minutes on release builds, almost sleeping throughout the builds.

w1ggor avatar Sep 05 '23 13:09 w1ggor

@drasticactions I didn't hear back on this. It takes 6 seconds to build an xcode project on the same Mac Mini.

Inrego avatar Sep 05 '23 13:09 Inrego

You should try adding some additional libraries into your project too. My project isn't that big and the development cycle time is about 5 minutes. I don't see how it's practical to develop realistically with such a slow development cycle for every minor change to the app DLL.

MarkMcCormackSF avatar Dec 21 '23 17:12 MarkMcCormackSF

Verified this issue with Visual Studio Enterprise 17.9.0 Preview 2. Can repro on iOS platforms with sample project.

homeyf avatar Jan 04 '24 07:01 homeyf