16

I am trying to run console.log from a js file for iOS application react native.

Before this, I have tried to use react native's debugging feature 'Shake Device' in which I couldn't succeed.

Now I am trying to run the command line debug console by react-native log-ios. It works with simulators but not with the real device and it gives me this error:

No active iOS device found
(node:26724) UnhandledPromiseRejectionWarning: undefined
(node:26724) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:26724) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Ronan Boiteau
  • 9,608
  • 6
  • 34
  • 56
Dev Qualwebs
  • 161
  • 1
  • 6

1 Answers1

1

The following worked for me (tested on react native 0.68.2):

npm install -g ios-deploy
# Run on a connected device, e.g. Sadia's iPhone:
react-native run-ios --device "Sadia's iPhone"
  • I lost days of productivity from this issue. Nothing I know change in my environment so I was flummoxed! Your solution worked. I don't know why RN lost the connection to `ios-deploy`, but now I have a fix. Thank you. When reloading from CLI, I still get `warn No apps connected. Sending "reload" to all React Native apps failed. Make sure your app is running in the simulator or on a phone connected via USB.` But I can shake to device to load the Metro menu. So not completely blocked. – Mike S. Mar 06 '23 at 16:05
  • Glad to hear that. Tested the same for 0.70.5 and it's working. – Sadia Chaudhary Mar 07 '23 at 11:12