Debug React Native Apps like a PRO

Adnan Sahinovic
Geek Culture
Published in
2 min readFeb 19, 2021

Small steps to debug your crashing Android app without error logs

As a mobile developer, it’s not uncommon that your app will crash or freeze once in a while without any specific reasons. Debugging the .apk file can cause many headaches since you won’t have your remote debugger connected and sometimes no error logs at all.

Android Debug Bridge

ADB is a command-line tool that lets developers an alternative way to communicate with a device. It provides us a way of installing and debugging apps via terminal.

It’s consist of client-server architecture, which holds three main components:

  • client: running on your machine and sending commands
  • daemon (adbd) runs commands on a smartphone device
  • server controls communication between the adbd and the client

adb is pre-included in the SDK Platform-Tools package for Android.

Installation

In case you have a crashing .apk file that doesn’t show any errors, you can use ADB command to install the app via the terminal.

  1. Make sure your simulator is up and running.
  2. Navigate to the same folder as your .apk file and execute the command:
adb install myAppName.apk

In case your app has any errors, you’ll see them now.

results: app not signed properly

Reloading

In case your app freezes and the physically shaking device doesn’t work, there is a command that will help you reload the app from the command line.

adb shell input text "RR"

ADB provides us access to a Unix shell that can run various commands on a device. This command tells the device to type “RR” which is the React Native command for reloading.

These are the most common and helpful ADB commands, but there are many others that you can use to level up your Android development.

https://developer.android.com/studio/command-line/adb

--

--

Adnan Sahinovic
Geek Culture

Building tools on phones and browsers and documenting my expedition. React-Native since v0.5 • Android dev since KitKat