How can I debug memory leaks in react-native Expo project? - react-native

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!

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://reactnative.dev/docs/debugging

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.

Related

Appcelerator/ Titanium Alloy - No Andriod SDKs were found under the specified SDK Location

I am running Appcelerator on OSX.
When I try to set up an emulator on the Appcelerator IDE, by clicking:
"Run Configurations..." >
"Appcekerator Android Emulator - appname" >
"Emulator"
On the bottom of the screen it shows up with an error message saying:
Problems detected with the SDK settings. Click here for details
Upon clicking for more details, it shows the error message:
An error was detected with the SDKs configuration
Reason:
[Android SDK Home] No Android SDKs were found under the specified SDK location
The value i have put for Android SDK home was:
/Users/username/Library/Android/sdk
How do I solve this issue?
Instead of using the Emulator which are slow and heavy in terms of Memory Usage, I would suggest you to use the GenyMotion for Android which is quite fast and easy to use and has close features to a physical device.
But First this First, setup the Android SDK for Appcelerator through Preference > Platform > Android and browse the Android SDK folder and Android NDK.
Note : This can be anywhere in the system folder.
You can download the GenyMotion Tool from the below link : https://www.genymotion.com/fun-zone/
Setting up the tool is quite simple and is given in the image itself.
Good Luck, Cheers
I had the same problem as above. I did move my Android SDK home out of '~/Library/' folder.
Previously it was:
'~/Library/android-sdk-macosx'
Then i moved it like:
'~/android-sdk-macosx/'
Most probably, the Library folder not visible to AppceleratorStudio. My guess.
Thanks a lot, guys.

How do i install a react-native debug build to device with production-like optimized performance?

I want to use my app on my phone with smooth animation and production-like performance, but i want it to show red screen whenever error happens and to be possible to debug this app with remote-chrome-debugging. How do i do that?
For Android, you can just open the developer menu by shaking the device or emulator, and in Dev Settings, uncheck 'JS Dev Mode'. Also you can tweak other options if you are interested. As for iOS, I am not entirely sure how you can do it.

React Native debug

Iā€™m doing a React Native project. It has a bug.
The bug make the APP just exit(it can functional run a while, but suddenly...just gone). So it dose not report error. How can I find out where the problem is?
My APP used react-native-bluetooth-serial.
My code on Github
Are you running it on you simulator.
If that is so you have to use real device for testing it as simulators do not have access to bluetooth peripherals.
Hope this helps.
You can use Genymotion or real device to use bluetooth enabled app. To test your bug you can also use "Debug JS remotely" feature of react native dev tools.
To enable dev tools in your real device, shake your device and dev menu will appear. In emulator you can press Ctrl + M to enable dev menu. then you can choose "Debug JS remotely" which will open in chrome. If you are familiar with web development then you might have used "Inspect element" feature which will open dev tools.
The answers are right. You might be using a simulator which doesn't support bluetooth.
To know more about the crash you can check the logs natively. For android just run this inside your android folder
adb logcat
Or you can use
react-native log-ios
react-native log-android

Titanium app immediate crash on BB10.2

I've been developing an app with Titanium, and I've got the app up and running on both iOS and Android.
Today I set up the Blackberry 10 environment to be used with Titanium and tried to compile and deploy to the simulator... It worked! But alas, after a brief peek at the appcelerator splash screen, the app crashes; all without any errors, warnings, or logs of any kind.
I've used telnet to see if there were any logs in the '1000' directory, and the logfile was empty for my app.
From what I've read in appcelerator's documentation and what I've discovered in the Titanium Studio software, Blackberry debugging support is not included.
Further information: I'm using the Parse JS library (not as a titanium module, just as a JS import) and my main window contains a TabGroup.
If anyone has any experience in Titanium for BB10 or insight as to what may point me in the right direction, that would be amazing.

Appcelerator Titanium does not run with sample application KitchenSink

I've installed Appcelerator Titanium Studio on a PC and I was not able to run the android simulator on it, so I was saying to myself "it should work on Mac at least"... and I installed a new Mac with Titanium on it, downloaded the SDK, then I imported the Kitchen Sink example and configured the run configuration with the default settings... and I'm getting exactly the same problem which is an infinite loop with the 'audio_flinged died' problem! So the best I can do is to view the Android simulator with the black window and "Android..." written on it.
What can I do to finally launch that example that is supposed to run? The best I did with my Windows 7 setup was to get the screen of an android cellphone WITHOUT any app on it (default apps), so it's pretty unuseful.
I'd really like to see what Titanium is capable to do.
The Mac ends (after a few mins) with "Launching New_configuration" has encountered a problem. Session initialization failed. "Session initialization failed Failed to get version"
The problem of the infinite loop with "AudioFlinger" still persist in the two cases (PC/Mac).
Any help would be greatly appreciated.
I helped someone with a similar question. He was getting a error which you don't seem to be but my answer walked him through checking the configuration was ok etc.
might help you:
Error running Android emulator from Titanium Studio