Search code examples
react-nativereload

React-native run and reload app show blank screen


I have built project react-native (on window) . When I connected device and run app ( react-native run-android) or reload app it just show blank-space, but if I pressed ctrl+S in visual code, app would fast refresh and run success. If I disconnected device, app would show blank screen again. How do I run app success without connecting device ? This is my version react-native

"dependencies": {
"@react-native-community/viewpager": "^2.0.2",
"firebase": "^7.2.3",
"react": "16.9.0",
"react-native": "0.61.3",
"react-native-gesture-handler": "^1.5.0",
"react-native-reanimated": "^1.4.0",
"react-native-screens": "1.0.0-alpha.23",
"react-native-swipe-gestures": "^1.0.4",
"react-native-swipeable": "^0.6.0",
"react-navigation": "^4.0.10",
"react-navigation-stack": "^1.10.3",
"realm": "^3.4.2",
"rn-fetch-blob": "^0.11.2"}

Solution

  • There are 3 ways :

    1.) You have to build an APK of app from android, if you want to run the app without using react-native run-android command, but it would be a static app if you dont what to develop further.

    2.) You can use hot refresh and hot reload.

    3.) By using ADB connection.

    I am guessing you are disconnecting your device, and hoping to see the same functionality without generating signed apk. Is that so?