skip to Main Content

I’m really confused on the following topics,
1.expo-dev-client (why not expo go?)
2.npx expo prebuild
3.npx expo run:ios/android

I’m coming from react-native-cli background and I really feel overwhelming after finding documentations and videos for the above topics. I didn’t understand what the documentation says too. Can somebody tell me the purpose of the above topics. I know what npx expo prebuild does. but I’m not sure whether other things do or doing the same thing as prebuild does. And why I saw some people have commented better using expo-dev-client than expo go. Can somebody briefly explain. Thanks. I really appreciate

2

Answers


  1. Certainly, let me break down the topics you mentioned:

    1. expo-dev-client vs. expo go:

      • Expo Go: Expo Go is the official Expo client app that allows you to run your Expo projects directly on your device. You can use it to test your app during development without the need for building and installing standalone binaries.
      • expo-dev-client: Expo Dev Client is an alternative to Expo Go. It provides a more advanced development client that offers features like hot module reloading (HMR) and faster development iteration. It’s particularly useful for larger projects where faster feedback during development is crucial. Expo Dev Client is considered experimental and might have some limitations compared to Expo Go.
    2. npx expo prebuild:

      • The npx expo prebuild command is used to prebuild Expo projects. This is useful in scenarios where you want to create a production-ready build of your Expo project, such as for CI/CD workflows or building standalone binaries without requiring the Expo CLI to be installed on the build server.
    3. npx expo run:ios/android:

      • These commands are part of the Expo CLI and are used to run your Expo project on an iOS or Android simulator or emulator during development. They simplify the process of starting your app on a specific platform, and you can use them interchangeably based on whether you are targeting iOS or Android.

    In summary:

    • Expo Go is the standard way to run and test Expo projects on your physical device.
    • Expo Dev Client is an experimental alternative that provides additional features for faster development but might have some limitations.
    • npx expo prebuild is used to prebuild Expo projects, especially for scenarios like CI/CD.
    • npx expo run:ios/android is used for running your Expo project on iOS or Android simulators/emulators during development.

    The choice between Expo Go and Expo Dev Client depends on your specific needs and preferences. Expo Go is more stable and mature, while Expo Dev Client offers advanced features for faster development but may have some experimental aspects.

    Login or Signup to reply.
  2. When you’re first starting a new Expo project, you might reach for Expo Go because it’s pre-built and will run a standard Expo-based app pretty easily. This can be the fastest option.

    But once you’re ready to:

    1. Modify any native code for your app
    2. Ask other people to test out the app on real devices

    You should move over to expo dev client. Expo dev client will create basically a "custom" version of Expo Go, specifically for your app. It’s a little more complicated than that, but that’s a good way to think about it.

    For most projects, you really shouldn’t need expo prebuild. It’s an escape hatch to make sure Expo users aren’t totally locked in to Expo tools. The idea is you take your Expo project and use it as a source to generate the native code. It’s what they’ll do for you in the EAS build services. You can run it locally. I usually use it to troubleshoot EAS errors on my machine. I run it very infrequently.

    Since expo prebuild will generate Android and iOS folders for you, in theory, you could use it kind of like you would with regular React Native CLI – to build all of the native components of your React Native app. But with Expo dev client, you basically never need this.

    I do not agree with the characterization of Expo dev client as experimental. At one point that was true (when they were developing it!) but these days, it’s a viable option, and it’s the recommended path to take when doing Expo app development that touches native code.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search