-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Process.Start() should be supported on MacCatalyst #61295
Comments
Tagging subscribers to this area: @dotnet/area-system-diagnostics-process Issue DetailsDescriptionIn MAUI, Mac UI is accomplished through Catalyst (UIKit for macOS) rather than AppKit. As a side-effect, various internals claim to be iOS. For example, If you try In short, I believe that line (and the equivalent for if ((OperatingSystem.IsIOS() && !OperatingSystem.IsMacCatalyst()) || OperatingSystem.IsTvOS()) In addition, the annotation Reproduction Steps
var p = System.Diagnostics.Process.Start("/bin/ls"); Expected behaviorNo warning should appear, and the process should launch. Actual behaviorA warning appears, and launching the process throws in Regression?This is arguably a regression compared to the Xamarin/Mono toolchain, because it targeted Cocoa (AppKit), not Catalyst (UIKit), where this wasn't a problem. Known WorkaroundsNo response Configuration
Other informationNo response
|
I am not familiar with Apple's technologies, but is launching arbitrary processes actually supported by Catalyst itself on Mac compiters? My guess is that since Catalyst looks more like iOS it also has some of its constraints, to be able to run on both tablets and computers. If you want to launch another app (not process) then I guess there is an API for that, but again I am not knowledgable at all. |
I copied the bulk of
I don't believe it does. You can use App Sandbox, but I don't think anything about Catalyst forces you into it. Now, since the majority of Catalyst apps will be iOS ports, it's safe to assume many of them won't use a feature that wouldn't also work on iOS. However, since the Xamarin/MAUI team (apparently?) chose to use Catalyst as the new UI toolkit for their Mac apps, I do think this is a relevant issue. |
@steveisok thoughts? Seems like the fix is easy unless we know of some pitfall. I wonder whether there are other places where we have |
Yeah, we marked the process start this way to keep in in sync with other Apple mobile platforms but the restriction could be removed if it makes sense to have it. @rolfbjarne for more context |
If it works fine (and there are tests that test that it works so that we find out if Apple restricts it somehow), then I think it makes sense (and it's fine) to enable Process.Start for Mac Catalyst. |
There was originally a problem with the |
We can turn the tests on and see what happens. Our motivation for treating this as PNSE was to match iOS/tvOS behavior. @danmoseley i don't believe there is anything mistakenly platform confused, but we will do a sanity check. |
@chucker any interest in offering a PR? We should ensure the tests are enabled for Catalyst at the same time. |
We had some internal discussion and we think this may work when sandbox mode is off. From what I understand, sandbox mode is required should you want to publish your catalyst app to the app store. What I think we'll try to do in addition to running tests is try to detect when sandbox mode is on and provide a good error message. |
To validate for MacCatalyst, we'll need to enable the |
Description
In MAUI, Mac UI is accomplished through Catalyst (UIKit for macOS) rather than AppKit. As a side-effect, various internals claim to be iOS. For example,
OperatingSystem.IsIOS()
will return true on a Mac if the app is a Catalyst app.If you try
Process.Start()
orProcess.Kill()
, you get aPlatformNotSupportedException()
. I believe this is by mistake, as starting and killing a process should be possible in macOS (but it indeed isn't in iOS).In short, I believe that line (and the equivalent for
Kill()
) should read:In addition, the annotation
[UnsupportedOSPlatform("ios")]
appears to be wrong, as it triggers a "unsupported onmaccatalyst
" warning.Reproduction Steps
net6.0-maccatalyst
, e.g. from the MAUI template.MacCatalyst
-specific code, call:Expected behavior
No warning should appear, and the process should launch.
Actual behavior
A warning appears, and launching the process throws in
StartCore()
.Regression?
This is arguably a regression compared to the Xamarin/Mono toolchain, because it targeted Cocoa (AppKit), not Catalyst (UIKit), where this wasn't a problem.
Known Workarounds
No response
Configuration
dotnet --info
output:Other information
No response
The text was updated successfully, but these errors were encountered: