问题
I am running a react-native Expo project on both ios simulator, which uses XCode, and android emulator, which uses genymotion. There is a crash sometimes when using the app on real android phone. I am hoping to find out the reason debugging it on the emulator.
So far, I searched for tools for this, but did not encounter any.
Could anyone tell me available tools for debugging memory leaks on genymotion emulator? I also welcome any other advices to fix my problem.
Thanks in advance!
回答1:
You can gain a ton of insight using Infinite Red's Reactitron
You might also want to check out Perf Monitor
which you can access from the Debug menu.
There's a whole page on profiling and troubleshooting perf issues in the react native documentation. https://facebook.github.io/react-native/docs/performance.html
回答2:
With Expo you'll need to detach.
For Android you can find tutorial here.
For iOS:
- Make sure you have Release Schema
- Go to XCode → Product → Profile (⌘ + i) and you'll find:
- It should open your leaks profiler on the screen and then click on the red dot.
- Restart the app in simulator.
- You should see your memory allocations in the leaks profiler window.
来源:https://stackoverflow.com/questions/46444793/how-can-i-debug-memory-leaks-in-react-native-expo-project