How to Test Run React Native Apps on Real Android Device In Windows

Real android device is extremely different from Android Emulator( Android Simulator ), because there are lots of features doesn’t exists in Android simulators. So in this tutorial we would going to learn about How to Test Run React Native Apps on Real Android Device In Windows XP, 7, 8, 10 and Also this tutorial is used same in MAC to test android apps. So let’s get started 🙂 .

There are a bunch of features that exist in Real Android Device:

  1. Real android device also known as Genuine Physical Android smart phone dose support all type of sensors like Gravity, Light, compass etc.
  2. It supports real time Audio calling, SMS messaging and Video calling.
  3. It has its unique IMEI (International Mobile Equipment Identity) number.
  4. It supports real time Image Capture functionality.
  5. It supports Real time video recording

Contents in this project Test Run React Native Apps on Real Android Device in Windows + Mac:

1. Enable USB debugging mode in your android device :

1. Goto -> Settings -> About Device .

2. Then Software Info.3. Then ->Build Number.

4. Now Tap (Click) multiple times on Build Number to Enable Developer Options.

5. Here you go not the Developer Options will be visible in your Settings.

6. Now Go inside the Developer Options and Enable USB Debugging Mode.

Here you go Guys now step 1 is completed.

2. Open your Android SDK Manger -> Platform Tools folder inside Command Prompt like i did in below screenshot.

3. Type adb devices  inside command prompt. After typing this command it will show your real phone connected to system.

4. Type adb reverse tcp:8081 tcp:8081  in command prompt.

5. Here you go friends, Now your react native application project is ready to run in Real Android Mobile phone. Just GO TO your project’s folder and initiate react-native run-android  command and your project will be automatically run into Real Android Device.

Run React Native Apps

27 Comments

  1. Hi!Same here… still building error.
    – USB debugging ->OK
    – adb devices -> shows only one device
    – adb reverse ->OK
    – react-native run-android -> Fail building

    Do you need to install specific sdk files or something in your Android Studio?

    If i click on the green “play” button in Android Studio, the application saying “Hello World” starts…

  2. How do you refresh after making some code changes?

  3. Wow nice one bro, this comes in handy. I am trying this out and using it in subsequent projects

  4. Works perfectly! Thank you ^_^

  5. Hi Dude, the steps helped me a lot, and it works fine 🙂

  6. hi . i do all step on this webpage .but when i do this step “react-native run-android” i get blow error :

    Starting JS server…
    Building and installing the app on the device (cd android && gradlew.bat installDebug)…
    Starting a Gradle Daemon (subsequent builds will be faster)

    > Configure project :app
    Observed package id ‘build-tools;26.0.0-rc2’ in inconsistent location ‘E:\android\sdk-full\Sdk\build-tools\26.0.0-preview’ (Expected ‘E:\android\sdk-full\Sdk\build-tools\26.0.0-rc2’)
    Project evaluation failed including an error in afterEvaluate {}. Run with –stacktrace for details of the afterEvaluate {} error.

    FAILURE: Build failed with an exception.

    * Where:
    Build file ‘E:\Train\React-Native\myapp\android\app\build.gradle’ line: 106

    * What went wrong:
    A problem occurred evaluating project ‘:app’.
    > Error: NDK integration is deprecated in the current plugin. Consider trying the new experimental plugin. For details, see http://tools.android.com/tech-docs/new-build-system/gradle-experimental. Set “android.useDeprecatedNdk=true” in gradle.properties to continue using the current NDK integration.

    * Try:
    Run with –stacktrace option to get the stack trace. Run with –info or –debug option to get more log output. Run with –scan to get full insights.

    * Get more help at https://help.gradle.org

    BUILD FAILED in 1m 59s
    Could not install the app on the device, read the error above for details.
    Make sure you have an Android emulator running or a device connected and have
    set up your Android development environment:
    https://facebook.github.io/react-native/docs/getting-started.html

  7. Hello, I like your blog and will revisit soon. Can you clarify if this still works? 5/4/2019

    Thanks

Leave a Reply

Your email address will not be published. Required fields are marked *