How do you develop React Native apps?

I guess my question is whether or not you use the Android or iOS simulator to work with React Native apps. I have a MacBook pro that I’ve been using for a couple of years now (like 4 years give or take) and running the iOS simulator seems like a pain, it’s way too slow.

Running react-native run-ios to start the simulator for the development process takes forever, like 15 minutes or more. Then after it’s finally up, my MacBook feels slow, it’s very annoying. I’m using xcode for the simulator BTW.

I was wondering if anyone here has experienced the same and found a better way to work with React Native.

Would it be just better to use my Iphone instead of the simulator? Is this related to launching the xcode app by any chance?, is Android simulator lighter?

1 Like

I loved learning RN, but getting the environment set up was ridiculously difficult. Seriously, it took weeks. And it’s still buggy.

I think there is something wrong with your xcode setup, but sorry, I can’t help you with that.

Most things in RN are roughly the same for most things. I would go ahead and develop on Android and then test on iOS once you’re there.

1 Like

It doesn’t throw any error, everything seems to be fine.

However that’s not what I’m supposed to see on the screen (I only have an input element and a button, not that text), the simulator looks like it’s frozen because I even press the home button (in the hardware tab) and nothing happens. My guess is that my machine is too weak to run the iOS simulator, if that is the case then I find it a bit ridiculous to be honest. I mean you will need a freaking super computer to develop RN apps?

I’d like to know if this is related to the xcode app, I might try the Android simulator and see if it works smoothly.

BTW, do you use the simulator or launch the app directly on your phone? Or you don’t use neither and instead just use the browser (although the latter wouldn’t be native code?)

I really really want to use this technology because I love working with React and I don’t like ionic (Angular) syntax at all, but if this is going to be like this… Then I’m screwed :confused:

As we talk the simulator is finally up and running.

So yeah, it seems my MacBook Pro is not strong enough to run this simulator smoothly, it takes forever to get this thing up and running.

Kevin, what exactly do you use? Do you use the simulator at all or launch it on your phone?

How much RAM do you have? What kind of processor do you have?

MacBook Pro (13-inch, Mid 2012)
Processor 2.5 GHz Intel Core i5
Memory 4 GB 1600 MHz DDR3
Graphics Intel HD Graphics 4000 1536 MB

I know I need to clean my machine because I’ve been using for like 4 years now and I used to run rendering programs, but I just can’t believe I can’t run this simulator smoothly.

Processor is fine, but 4 gb of RAM is probably not enough. If you open task manager, you can look at the processes tab and see if xcode is contributing to a high percentage usage of your RAM . If it’s similar to Android studio, it will use a ton (with 4gb). I had to upgrade to 8 gb so I can develop Android apps comfortably . You could increase paging file size (Google how to do that, hope you have SSD and not hdd), but I’d recommend 8gb RAM at least. Most people will say 16 gb for professionals, but I guess it depends.

Yeah I figured I’d probably have to upgrade my machine, that is good to know. I just wanted to know if xcode consumes a lot of RAM and you answered that question. Thanks a lot man.

Yeah, emulators like this are vey memory hungry. I think I was struggling with 6 gb.

1 Like

np. Try and run your app with a real device and see if it’s manageable. And maybe xCode has some sort of config for low ram devices.

Good luck

I was running the app on my iPhone but for some reason as soon as I installed NativeBase library it was throwing an error, not sure why. But yeah it seems I’ll be better off just using a real device in the mean time.

Am I wasting my time trying to use this technology? It’s getting ridiculously hard to get a simple app up and running quickly, jesus.

I added more RAM to my machine and now the simulator works fine. But I’m running into this error:

Any ideas what it could be? I followed the guide here Introduction · React Native

What I don’t get is that I had another project that was working fine until I decided to use a third party library and threw an error, so I deleted that one and installed a new one, now the above happened.

yeah, React Native isn’t easy. You should always look for useful tips on using RN.
One day these tips helped me, when I tried to upload background image.

Sorry for the late reply. I hope you figured it out. But it is saying that the variable is not defined, which it doesn’t appear to be. That is not a React Native or even a React problem, but is JavaScript.

Don’t worry, I solved the issue but I don’t really remember what the issue was but it wasn’t a JavaScript problem, it was definitely a RN issue with the emulator.

I think I just restarted the app and tried again. In any case setting up the environment to work with RN was a painful experience, at the end we went with Ionic and today I’d probably use Expo unless I know the app is going to do some things that are only possible with the native modules.

I’m just reading the code in the window - it is referencing a variable that doesn’t exist and that is what the error message is saying. The variable on line 10, instructions, isn’t defined anywhere and that is exactly what the error message is saying.

But OK. I’m glad you got it working.

Hey @Gilbert1391 , so did your 8GB upgraded RAM appear smooth in running the iOS simulator/Android emulator finally? How is it performing when you re-render in the emulator/simulator on updating your code? Is it fast and convenient in development?
I have exactly same configuration MBP and I am considering it to upgrade.