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

Incomplete console output when debugging MAUI app on iOS device #21180

Closed
thisisthekap opened this issue Sep 4, 2024 · 7 comments
Closed

Incomplete console output when debugging MAUI app on iOS device #21180

thisisthekap opened this issue Sep 4, 2024 · 7 comments
Labels
enhancement The issue or pull request is an enhancement
Milestone

Comments

@thisisthekap
Copy link

thisisthekap commented Sep 4, 2024

Apple platform

iOS

Framework version

net8.0-*

Affected platform version

8.0.401

Description

After installing AppsFlyerXamarinBinding, no console output is shown when debugging on device, but shown in simulator.

Important notes:

  • The same applies to other third party dependencies. Appsflyer is just an example to showcase the issue.
  • The issue was reproduced using Visual Studio Code, but is reproducible as well using JetBrains Rider.
  • Edit: This issue is present using several different iOS versions on devices (e.g. 17.6.1, 17.5, ...)

Steps to Reproduce

Repository with reproduction

https://github.com/thisisthekap/mauiiosloggingissue

Repro Steps

  1. dotnet new maui
  2. dotnet add package AppsFlyerXamarinBinding
  3. Add that code to the simulator:
  public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
  {
	AppsFlyerLib.Shared.IsDebug = true;
	AppsFlyerLib.Shared.Start();

      return base.FinishedLaunching(application, launchOptions);
  }
  1. Run on simulator
  2. Output like [AppsFlyerSDK] [com.appsflyer.serial] [START] Initial start of the application is shown on the debug console
  3. Run on device
  4. No output like [AppsFlyerSDK] [com.appsflyer.serial] [START] Initial start of the application is shown on the debug console

Did you find any workaround?

No response

Relevant logs

No response

@thisisthekap
Copy link
Author

thisisthekap commented Sep 5, 2024

A note on the severity of this issue: For us, having the full console output just on Simulator breaks MAUI development. We need to have reliable console output on devices, specifically iOS, in order to test device specific stuff such as IDFA constent and purchase related stuff.

@thisisthekap thisisthekap changed the title No console output is shown when debugging on device, but shown in simulator Incomplete console output when debugging MAUI app on iOS device Sep 5, 2024
@rolfbjarne
Copy link
Member

This is due to the fact that last year (in iOS 17 / Xcode 15), Apple completely rewrote their libraries to interact with devices, and in the process didn't leave us any way to capture stdout/stderr from the process on device.

The good news is that they've fixed this for iOS 18 / Xcode 16, so once we've released .NET 9 (with support for iOS 18) this will work.

@rolfbjarne rolfbjarne added the enhancement The issue or pull request is an enhancement label Sep 5, 2024
@rolfbjarne rolfbjarne added this to the xcode16 milestone Sep 5, 2024
@thisisthekap
Copy link
Author

@rolfbjarne Is there any way to backport this to the current stable?

@rolfbjarne
Copy link
Member

rolfbjarne commented Sep 5, 2024

@rolfbjarne Is there any way to backport this to the current stable?

No, because you also need to update to iOS 18 on your device and use Xcode 16.

You can view the output in the Console app though: https://support.apple.com/en-in/guide/console/cnsl1012/mac

@thisisthekap
Copy link
Author

@rolfbjarne Thank you for your assistance!

@thisisthekap
Copy link
Author

@rolfbjarne An additional finding: On initial deployment to a device, there seems to be no output at all (no loggers, no stdout, nothing in console). This makes me believe that this issue might be related to #21186

@rolfbjarne
Copy link
Member

Closing since this will be fixed once we release Xcode 16 support.

In the end I discovered that it won't be necessary to upgrade any device, as long as you're using Xcode 16, it'll still work for devices with only iOS 17 installed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement The issue or pull request is an enhancement
Projects
None yet
Development

No branches or pull requests

2 participants