fpillet / NSLogger

A modern, flexible logging tool
Other
5k stars 573 forks source link

No output in desktop app when logging from iOS 14 #295

Closed rzolin closed 1 year ago

rzolin commented 4 years ago

The same build running on iPhone X with iOS 14 and iPhone 6S iOS 12. The desktop app shows only output for iOS 12. I've upgraded to latest Desktop app - no change. And I am using the latest (no version set) cocoapod. I was thinking about some permissions or other iPhone settings that could affect it, but couldn't find it. Right now it's not a major issue for the development, but something you need to be aware

fpillet commented 4 years ago

Have you tried using the latest master branch here? Thanks for letting me know anyway!

iGranDav commented 4 years ago

Just in case you were wondering here is the reason why 🙂 https://developer.apple.com/videos/play/wwdc2020/10110/

TL;DR: Apple is now blocking local network calls if you don't ask user's permission first.

dskuza commented 4 years ago

@iGranDav definitely pointed us in the right direction. Two steps:

  1. Add the NSLocalNetworkUsageDescription key-value pair to your Info.plist file. a. The value type should be a string.
  2. Add the NSBonjourServices key-value pair to your Info.plist file. a. The value type should be an array. b. By adding _nslogger._tcp as an entry in the array, I was able to get NSLogger to display logs once again.
fpillet commented 3 years ago

Geez. Now I need to add Info.plist checks so as to warn developers that they need to add proper keys in order for NSLogger to work !

Thanks a lot for the workaround @dskuza ! 👍

fpillet commented 3 years ago

Note that for NSLogger to work correctly in all cases, you also need _nslogger-ssl._tcp in the Bonjour services list. Add the whole following block to your Info.plist:

    <key>NSBonjourServices</key>
    <array>
        <string>_nslogger._tcp</string>
        <string>_nslogger-ssl._tcp</string>
    </array>
    <key>NSLocalNetworkUsageDescription</key>
    <string>Access to the local network for development builds</string>
niltsh commented 3 years ago

Saved my day. thank you.

KrauseFx commented 1 year ago

Thanks everyone, ran into this as well, and just filed a PR to include this info in the README https://github.com/fpillet/NSLogger/pull/311

JohnnyTseng commented 1 year ago

Saved my day, thanks!!

0xced commented 1 year ago

311 is merged, the information is now in the README.

Thanks @KrauseFx! 🚀