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

Question: iOS Logs are not visible in client #484

Closed
felislynx-silae opened this issue Jul 10, 2019 · 16 comments
Closed

Question: iOS Logs are not visible in client #484

felislynx-silae opened this issue Jul 10, 2019 · 16 comments
Assignees
Labels
bug Something isn't working iOS Stale

Comments

@felislynx-silae
Copy link

I've completed setup for app. I see Layout/Network/SharedPreferences plugins and they work. But i don't get any logs Logs (print,nslog,oslog). It is working only for android. Is it a bug or i've setup something else?

@passy
Copy link
Member

passy commented Jul 10, 2019

There shouldn't be anything you need to setup. @priteshrnandgaonkar do you have any ideas how to debug this?

@bizzguy
Copy link
Contributor

bizzguy commented Aug 6, 2019

I am having a similar issue. I can't see any logs for a physical ios device. For a simulator, I see some log messages but not custom log messages written in the app. The log messages I see seem to be coming from the phone os itself.

@priteshrnandgaonkar priteshrnandgaonkar self-assigned this Aug 16, 2019
@priteshrnandgaonkar
Copy link
Contributor

Apologies for the late reply. It works for me. I built the Flipper app from the source. yarn && yarn start and it showed the custom NSLog which is added in the AppDelegate here

Screen Shot 2019-08-19 at 8 30 58 PM

@priteshrnandgaonkar
Copy link
Contributor

Can you open the console (cmd + option + i) and check if there is any error ?

@felislynx-silae
Copy link
Author

I'm using latest version 0.23.4 (installed, autoupdated)

adbClient.js:42 Failed to create adb client using shell adb command. Trying with adbkit.
Error: Command failed: /opt/android_sdk/platform-tools/adb start-server
/bin/sh: /opt/android_sdk/platform-tools/adb: No such file or directory

(anonymous) @ adbClient.js:42
adbClient.js:59 Failed to start adb client. Retrying. spawn adb ENOENT
(anonymous) @ adbClient.js:59
androidDevice.js:84 Error: Command failed: /opt/android_sdk/tools/emulator -list-avds
/bin/sh: /opt/android_sdk/tools/emulator: No such file or directory

    at ChildProcess.exithandler (child_process.js:308)
    at ChildProcess.emit (events.js:194)
    at maybeClose (internal/child_process.js:998)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:265)
(anonymous) @ androidDevice.js:84
adbClient.js:59 Failed to start adb client. Retrying. spawn adb ENOENT
(anonymous) @ adbClient.js:59
adbClient.js:59 Failed to start adb client. Retrying. spawn adb ENOENT
(anonymous) @ adbClient.js:59
adbClient.js:59 Failed to start adb client. Retrying. spawn adb ENOENT
(anonymous) @ adbClient.js:59
adbClient.js:59 Failed to start adb client. Retrying. spawn adb ENOENT
(anonymous) @ adbClient.js:59
internal/process/warning.js:23 (node:2348) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
writeOut @ internal/process/warning.js:23
IOSDevice.js:94 Error from getpwuid_r: 102 (Operation not supported on socket)

(anonymous) @ IOSDevice.js:94
adbClient.js:59 Failed to start adb client. Retrying. spawn adb ENOENT
(anonymous) @ adbClient.js:59
androidDevice.js:146 Failed to watch for android devices: spawn adb ENOENT
(anonymous) @ androidDevice.js:146

There is no log from print or NSLog, i'm using swift not objective c in project if that makes a difference

My init:

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
       let client = FlipperClient.shared()
       let layoutDescriptorMapper = SKDescriptorMapper(defaults: ())
       FlipperKitLayoutComponentKitSupport.setUpWith(layoutDescriptorMapper)
       client?.add(FKUserDefaultsPlugin())
       client?.add(FlipperKitNetworkPlugin(networkAdapter: SKIOSNetworkAdapter()))
       client?.add(FlipperKitLayoutPlugin(rootNode: application, with: layoutDescriptorMapper!))
       client?.start()
       return true
   }

@priteshrnandgaonkar
Copy link
Contributor

I am able to reproduce the issue on the swift sample app. Let me see what is the issue.

@GioLogist
Copy link

Can confirm. I'm having a difficult time getting iOS Simulator to work as well.

Initialized via

react-native init reactNative610Rc --version react-native@0.61.0-rc.0

Android logs show just fine, but not iOS.

Same for simulator (not even app-specific). Android simulator logs show, but not iOS

@priteshrnandgaonkar
Copy link
Contributor

the problem is with the swift apps not with an objective c apps.

@passy passy added bug Something isn't working iOS labels Sep 25, 2019
@heyman333
Copy link

I could see NSLOG but console.log is not showing

@priteshrnandgaonkar
Copy link
Contributor

console.log won't show up in the Logs plugin. @mweststrate, are console.log in hermes debugger ?

@mweststrate
Copy link
Contributor

console.log should show up in the Logs plugin under the React Native device, that should show up as soon as you start metro (in RN 0.62+) (They will not show under the physical device, that one only shows the IDB / ADB logs)

@wbercx
Copy link

wbercx commented Apr 20, 2020

If it's your first time running Flipper, restart it.

It did not initially work for me either. The only thing that showed up in Flipper was a single dep_graph_loaded event. Layout, Network, React DevTools all worked fine. The Restart and Menu buttons at the top left did nothing.

Restarting Flipper fixed everything.

The Plugin Status tab under Manage Plugins still complains it cannot connect to my actual app though, but I don't appear to be having any issues.

@jbrodriguez
Copy link

jbrodriguez commented Apr 25, 2020

Hi, I'm trying to read console.log via the React Native Logs plugin, but it says 'client_log : JavaScript logs will appear in your browser console'.

Also it always opens a Chrome tab for 'http://localhost:8081/debugger-ui/'.

I thought Flipper would replace that.

any thoughts ?

P.S.: Ok, I disabled debug on the device and now it works

@aldegoeij
Copy link

I can confirm that disabling debugging in the 'shake' menu results in the logs showing up just fine (warn, debug, etc), however, now I cannot debug in my IDE anymore :D

Any idea why debugging mode would block logs from coming through?

I'm using Sentry, and its initialization logs are coming through just fine, but only in the device logs, not the React Native logs.

@stale
Copy link

stale bot commented Sep 13, 2020

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale label Sep 13, 2020
@stale
Copy link

stale bot commented Oct 4, 2020

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working iOS Stale
Projects
None yet
Development

No branches or pull requests

10 participants