There is 2 activities inside AndroidManifest.xml
when you init new project by react-native
, the first one is MainActivity
and the second one is com.facebook.react.devsupport.DevSettingsActivity
. What's the usage of the second one?
Adding to the accepted answer, for those who are wondering how to add this activity to debug manifest, follow these steps
<project_root>/andorid/app/src
and name it debug
AndroidManifest.xml
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<application android:usesCleartextTraffic="true" tools:targetApi="28" tools:ignore="GoogleAppIndexingWarning" >
<!-- This activity will be removed for release builds -->
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity"
android:exported="false"/>
</application>
</manifest>
This should be done if you plan on debugging your app over the local network using wireless debugging on Android. Hope someone finds this helpful.
You can find explanation of this activity at the header of the file
DevSettingsActivity.java under $ProjectRoot\node_modules\react-native\ReactAndroid\src\main\java\com\facebook\react\devsupport\DevSettingsActivity.java:
- Activity that display developers settings. Should be added to the debug manifest of the app.
- Can be triggered through the developers option menu displayed by {@link DevSupportManager}.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With