Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you build a react-native iOS app using WINDOWS?

Can you build for iOS with react-native on Windows? Or does it require xcode?

If so, any work arounds? I dont want to work on a mac... or a mac vm.

like image 498
Kenny Johnson Avatar asked Sep 09 '19 23:09

Kenny Johnson


People also ask

Can you develop iOS apps on Windows with React Native?

React Native is an open-source mobile application framework created by Facebook. It is used to develop applications for Android, iOS, Web and UWP (Windows) providing native UI controls and full access to the native platform. Working with React Native requires an understanding of JavaScript fundamentals.

Do I need a Mac to develop iOS apps with React Native?

A Mac device is required to build projects with native code for macOS. Install Xcode version 11.3.

Can React Native develop iOS app?

React Native combines the best parts of native development with React, a best-in-class JavaScript library for building user interfaces. Use a little—or a lot. You can use React Native today in your existing Android and iOS projects or you can create a whole new app from scratch.


2 Answers

I think the app you create with react-native will work with iOS but you might just have to develop it without an iOS SDK. (essentially, you can't really see the app in a virtual iOS device whilst developing).

However, i think if you develop the app for android using android studio SDK with react native, the app should also work with iOS as well. It's just that you won't really be able to see the app in development on a virtual iOS device.

Another option is to use expo when using react native. Essentially, it displays your app on your iphone so you can technically do app development whilst viewing the app on an iOS device, but I don't think its that great as you can only see it on your phone, whilst I prefer to use a virtual device on my laptop.

You can view documentation for expo in the react native docs here: https://facebook.github.io/react-native/docs/getting-started

I'd recommend you to just develop the app for android using the android SDK from Android studio. This also works with expo or react native CLI. Although you may have to develop the app in a virtual android device, I think the app also works with an iOS device (it may just look a little bit different e.g. a button in android will look different to a button on iOS)

Here's a tutorial that really helped me with learning React-Native: https://www.youtube.com/watch?v=NuZOwsmzcro Just follow the steps and make sure you install an android SDK. Then once you get to around "9:25", instead of starting up an iOS emulator from an iOS SDK, start up the android one from android SDK, then hit the button "a" to choose android and you're all set!

like image 52
Bigboybob Avatar answered Sep 30 '22 17:09

Bigboybob


The short answer is NO. iOS apps need to build on a Mac. However, if you have a cheap old Mac, or even a Mac cloud account, you can effectively do the equivalent while (almost) never touching the Mac. Of course, this assumes that it has been setup up once, and builds via Xcode or Xcode command line. Once that is done, you can automate it so that you're working and testing only on the PC.

For example, I once took over a React Native project where the previous developer did something similar. Because it was a generic interface, he coded on his PC, then tested via the Android emulator without ever testing for iOS. At that point you can simply push code to GitHub (manually, or with something like Fastlane or a user script). Separately, you have a script on that old Mac or online Mac-as-a-service that checks periodically and builds when the code changes. There were some times when the Mac needed special attention, but for the most part, it worked solely on one machine.

like image 41
Eddie Eddie Eddie Avatar answered Sep 30 '22 17:09

Eddie Eddie Eddie