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

Add support for running the iOS app on macOS without the simulator #145908

Closed
ellet0 opened this issue Mar 28, 2024 · 5 comments
Closed

Add support for running the iOS app on macOS without the simulator #145908

ellet0 opened this issue Mar 28, 2024 · 5 comments
Labels
r: duplicate Issue is closed as a duplicate of an existing issue

Comments

@ellet0
Copy link

ellet0 commented Mar 28, 2024

Use case

First of all I'm not sure if this a duplicated issue or can't be supported by flutter side, Xcode support this feature of running the the iOS app on macOS directly and the native code like request notifications permissions of iOS will run as if it was on macOS without having to have the macOS project at all

image

I can run the iOS project on macOS without any issues using Xcode by open the iOS native platform project which will be created by flutter create . --platforms=iOS but features like hot reload and hot restart is not available, I'm wondering if flutter can add support for running and show it in the list of available devices:

image

Proposal

It would be really nice if we can launch the iOS app on macOS using Flutter CLI as almost macOS app without the simulator or having to sign and maintain a different platform project

All what is missing the hot reload and hot restart features and add it to the list of devices in Flutter CLI which will affect both Android Studio and VS Code

Yes it can't replace platform native macOS project but there is a lot of flutter plugins that still doesn't have good support for macOS as the iOS and Android and I'm having build issues all the time with CocoaPods

I was able to launch my iOS app on macOS and the native functions like requesting the notifications permission on the iOS app will delegate to the macOS function

image

I'm not sure if this is already available or it's just a simple PR or require a lot of changes in order to support it

@moffatman
Copy link
Contributor

I always run my app like this, I agree on all the benefits, especially plugins like video/webview.

  1. flutter build ios from command line
  2. Run app on "My Mac (Designed for iPad)" in Xcode
  3. flutter attach from command line

Then I can hot reload/hot restart by pressing r / R in my terminal. Nothing automatic on save in VSCode or debugger. But I don't really bother with those anyways. Perhaps it is possible to "attach" from VSCode, but I've never tried.

If I remember right, the decision by Flutter top brass was not to add it as a "device" to run directly to avoid confusion (to be honest, it is quite a confusing feature, without proper official naming). See #84411.

Also this feature seems to be buggy from Apple. Sometimes the app freezes for a few seconds, I checked in Instruments, it has some hang inside UIKit in input event processing. Or also, after I upgraded to macOS 14.4, my app can't even launch any more, I have to temporarily change the bundle ID.

@stuartmorgan
Copy link
Contributor

Closing as a duplicate of #125741.

@stuartmorgan stuartmorgan closed this as not planned Won't fix, can't repro, duplicate, stale Mar 28, 2024
@stuartmorgan stuartmorgan added the r: duplicate Issue is closed as a duplicate of an existing issue label Mar 28, 2024
@stuartmorgan
Copy link
Contributor

and I'm having build issues all the time with CocoaPods

FYI, nothing changes about the build process when using this mode, so adding this device target would not help with any build issues.

@ellet0
Copy link
Author

ellet0 commented Mar 28, 2024

and I'm having build issues all the time with CocoaPods

FYI, nothing changes about the build process when using this mode, so adding this device target would not help with any build issues.

The native code for the plugins on the macOS might be different, plus it did for me

I can't use firebase crashlytics on a new blank project using the macOS target

And nothing helped fixing this issue and it has been for a while + I'm not the only one

Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
r: duplicate Issue is closed as a duplicate of an existing issue
Projects
None yet
Development

No branches or pull requests

3 participants