DEV Community

Cover image for Run debug and production react native app on same phone.
Fongoh Martin T.
Fongoh Martin T.

Posted on

Run debug and production react native app on same phone.

When developing a mobile application in react native, we can use our phones to test the debug build. Sometimes, meeting the client, we have to build production (release apk) and show him or her. Building and installing this production release means we have to uninstall the debug from our phones.

This article shows a simple way to be able to have the same app installed twice on your device; one production release and one debug release.

This article is based on the assumption you already have a react-native project created / cloned from github.

  1. Go to your 'android/app/build.gradle'
  2. Locate the line which contains the app id, example

    applicationId "com.xxxxxx"

  3. Change the app id to any name, good example is using adding a .debug, eg

    applicationId "com.xxx.debug"

  4. Not a must but you can locateandroid/app/src/main/res/values/string.xml and change the name of the app <string name="app_name">Digital Renter</string> to <string name="app_name">MyAppName.Debug</string>

Now each time you run android, it will install a fresh new application, not overriding any production release you have installed giving you both debug and production on same phone.

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay