Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to debug in iOS real device on React Native project?

I'm making react-native project, it almost done so I am trying to test in real iOS device. Because I heard that push notification is only working in real device.

Okay, when I test it in Simulator, I can launch debugger through Cmd+R -> Turn on debugger, but How about real device?

Can I check console.log in real iOS device?

like image 337
ton1 Avatar asked Apr 18 '17 01:04

ton1


People also ask

How do I debug iOS app on real phone?

Click the Run button to build and run the app on the selected simulated or real device. View the status of the build in the activity area of the toolbar. If the build is successful, Xcode runs the app and opens a debugging session in the debug area.

How do I run a specific device in react native iOS?

Specifying a device​ You can specify the device the simulator should run with the --simulator flag, followed by the device name as a string. The default is "iPhone 13" . If you wish to run your app on an iPhone SE (2nd generation), run npx react-native run-ios --simulator="iPhone SE (2nd generation)" .

How do I debug in mobile react native?

In App Developer MenuOn Android emulator, you need to press command + M. Debug JS Remotely − Used for activating debugging inside browser developer console. Enable Live Reload − Used for enabling live reloading whenever your code is saved. The debugger will open at localhost:8081/debugger-ui.

How do you run react native app on iOS device from Windows?

Expo allows us to build for both Android and iOS on Windows, Mac and Linux. You can run your React Native app on a physical device without setting up the development environment. All you need to do is download the Expo Go app, run expo start and then scan the QR code that shows up.


2 Answers

Shake the device (to bring up the same menu you would bring up with cmd+D), then tap debug JS remotely

like image 188
MendyK Avatar answered Nov 01 '22 14:11

MendyK


It's always a good idea to test your app on an actual device before releasing it to your users. This document will guide you through the necessary steps to run your React Native app on a device.

https://facebook.github.io/react-native/docs/running-on-device.html

Hope this helps!

like image 38
Taj Chaitan Avatar answered Nov 01 '22 14:11

Taj Chaitan