当我运行react-native run-android时。它在我的Android设备上运行应用程序,但在运行所有组件后,它会自动断开连接。如果我想进行任何更改而不是需要再次运行相同的命令react-native run-android。并且我还需要在更改后每次构建捆绑。我怎么能解决这个问题。 使用以下方法创建包: -
react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/
使用此运行app: -
react-native run-android
并在终端上运行: -
Scanning 646 folders for symlinks in /var/www/fif-app/node_modules (5ms)
Starting JS server...
Building and installing the app on the device (cd android && ./gradlew installDebug)...
WARNING [Project: :app] Current NDK support is deprecated. Alternative will be provided in the future.
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:react-native-cookie:compileLint
:react-native-cookie:copyReleaseLint UP-TO-DATE
:react-native-cookie:preBuild UP-TO-DATE
:react-native-cookie:preReleaseBuild UP-TO-DATE
:react-native-cookie:checkReleaseManifest
:react-native-cookie:preDebugAndroidTestBuild UP-TO-DATE
:react-native-cookie:preDebugBuild UP-TO-DATE
:react-native-cookie:preDebugUnitTestBuild UP-TO-DATE
:react-native-cookie:preReleaseUnitTestBuild UP-TO-DATE
:react-native-cookie:prepareComAndroidSupportAppcompatV72301Library UP-TO-DATE
:react-native-cookie:prepareComAndroidSupportSupportV42301Library UP-TO-DATE
:react-native-cookie:prepareComFacebookFbuiTextlayoutbuilderTextlayoutbuilder100Library UP-TO-DATE
:react-native-cookie:prepareComFacebookFrescoDrawee101Library UP-TO-DATE
:react-native-cookie:prepareComFacebookFrescoFbcore101Library UP-TO-DATE
:react-native-cookie:prepareComFacebookFrescoFresco101Library UP-TO-DATE
:react-native-cookie:prepareComFacebookFrescoImagepipeline101Library UP-TO-DATE
:react-native-cookie:prepareComFacebookFrescoImagepipelineBase101Library UP-TO-DATE
:react-native-cookie:prepareComFacebookFrescoImagepipelineOkhttp3101Library UP-TO-DATE
:react-native-cookie:prepareComFacebookReactReactNative0451Library UP-TO-DATE
:react-native-cookie:prepareComFacebookSoloaderSoloader010Library UP-TO-DATE
:react-native-cookie:prepareOrgWebkitAndroidJscR174650Library UP-TO-DATE
:react-native-cookie:prepareReleaseDependencies
:react-native-cookie:compileReleaseAidl UP-TO-DATE
:react-native-cookie:compileReleaseRenderscript UP-TO-DATE
:react-native-cookie:generateReleaseBuildConfig UP-TO-DATE
:react-native-cookie:generateReleaseAssets UP-TO-DATE
:react-native-cookie:mergeReleaseAssets UP-TO-DATE
:react-native-cookie:generateReleaseResValues UP-TO-DATE
:react-native-cookie:generateReleaseResources UP-TO-DATE
:react-native-cookie:mergeReleaseResources UP-TO-DATE
:react-native-cookie:processReleaseManifest UP-TO-DATE
:react-native-cookie:processReleaseResources UP-TO-DATE
:react-native-cookie:generateReleaseSources UP-TO-DATE
:react-native-cookie:processReleaseJavaRes UP-TO-DATE
:react-native-cookie:compileReleaseJava UP-TO-DATE
:react-native-cookie:extractReleaseAnnotations UP-TO-DATE
:react-native-cookie:mergeReleaseProguardFiles UP-TO-DATE
:react-native-cookie:packageReleaseJar UP-TO-DATE
:react-native-cookie:compileReleaseNdk UP-TO-DATE
:react-native-cookie:packageReleaseJniLibs UP-TO-DATE
:react-native-cookie:packageReleaseLocalJar UP-TO-DATE
:react-native-cookie:packageReleaseRenderscript UP-TO-DATE
:react-native-cookie:packageReleaseResources UP-TO-DATE
:react-native-cookie:bundleRelease UP-TO-DATE
:react-native-custom-tabs:compileLint
:react-native-custom-tabs:copyReleaseLint UP-TO-DATE
:react-native-custom-tabs:preBuild UP-TO-DATE
:react-native-custom-tabs:preReleaseBuild UP-TO-DATE
:react-native-custom-tabs:checkReleaseManifest
:react-native-custom-tabs:preDebugAndroidTestBuild UP-TO-DATE
:react-native-custom-tabs:preDebugBuild UP-TO-DATE
:react-native-custom-tabs:preDebugUnitTestBuild UP-TO-DATE
:react-native-custom-tabs:preReleaseUnitTestBuild UP-TO-DATE
:react-native-custom-tabs:prepareComAndroidSupportAppcompatV72301Library UP-TO-DATE
:react-native-custom-tabs:prepareComAndroidSupportCustomtabs2501Library UP-TO-DATE
:react-native-custom-tabs:prepareComAndroidSupportSupportCompat2501Library UP-TO-DATE
:react-native-custom-tabs:prepareComAndroidSupportSupportV42301Library UP-TO-DATE
:react-native-custom-tabs:prepareComFacebookFbuiTextlayoutbuilderTextlayoutbuilder100Library UP-TO-DATE
:react-native-custom-tabs:prepareComFacebookFrescoDrawee101Library UP-TO-DATE
:react-native-custom-tabs:prepareComFacebookFrescoFbcore101Library UP-TO-DATE
:react-native-custom-tabs:prepareComFacebookFrescoFresco101Library UP-TO-DATE
:react-native-custom-tabs:prepareComFacebookFrescoImagepipeline101Library UP-TO-DATE
:react-native-custom-tabs:prepareComFacebookFrescoImagepipelineBase101Library UP-TO-DATE
:react-native-custom-tabs:prepareComFacebookFrescoImagepipelineOkhttp3101Library UP-TO-DATE
:react-native-custom-tabs:prepareComFacebookReactReactNative0451Library UP-TO-DATE
:react-native-custom-tabs:prepareComFacebookSoloaderSoloader010Library UP-TO-DATE
:react-native-custom-tabs:prepareComGithubDroibitCustomtabslauncherLauncher108Library UP-TO-DATE
:react-native-custom-tabs:prepareOrgWebkitAndroidJscR174650Library UP-TO-DATE
:react-native-custom-tabs:prepareReleaseDependencies
:react-native-custom-tabs:compileReleaseAidl UP-TO-DATE
:react-native-custom-tabs:compileReleaseRenderscript UP-TO-DATE
:react-native-custom-tabs:generateReleaseBuildConfig UP-TO-DATE
:react-native-custom-tabs:generateReleaseAssets UP-TO-DATE
:react-native-custom-tabs:mergeReleaseAssets UP-TO-DATE
:react-native-custom-tabs:generateReleaseResValues UP-TO-DATE
:react-native-custom-tabs:generateReleaseResources UP-TO-DATE
:react-native-custom-tabs:mergeReleaseResources UP-TO-DATE
:react-native-custom-tabs:processReleaseManifest UP-TO-DATE
:react-native-custom-tabs:processReleaseResources UP-TO-DATE
:react-native-custom-tabs:generateReleaseSources UP-TO-DATE
:react-native-custom-tabs:processReleaseJavaRes UP-TO-DATE
:react-native-custom-tabs:compileReleaseJava UP-TO-DATE
:react-native-custom-tabs:extractReleaseAnnotations UP-TO-DATE
:react-native-custom-tabs:mergeReleaseProguardFiles UP-TO-DATE
:react-native-custom-tabs:packageReleaseJar UP-TO-DATE
:react-native-custom-tabs:compileReleaseNdk UP-TO-DATE
:react-native-custom-tabs:packageReleaseJniLibs UP-TO-DATE
:react-native-custom-tabs:packageReleaseLocalJar UP-TO-DATE
:react-native-custom-tabs:packageReleaseRenderscript UP-TO-DATE
:react-native-custom-tabs:packageReleaseResources UP-TO-DATE
:react-native-custom-tabs:bundleRelease UP-TO-DATE
:app:prepareAnimatedAppReactNativeCookieUnspecifiedLibrary UP-TO-DATE
:app:prepareAnimatedAppReactNativeCustomTabsUnspecifiedLibrary UP-TO-DATE
:app:prepareComAndroidSupportAnimatedVectorDrawable2501Library UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72501Library UP-TO-DATE
:app:prepareComAndroidSupportCustomtabs2501Library UP-TO-DATE
:app:prepareComAndroidSupportSupportCompat2501Library UP-TO-DATE
:app:prepareComAndroidSupportSupportCoreUi2501Library UP-TO-DATE
:app:prepareComAndroidSupportSupportCoreUtils2501Library UP-TO-DATE
:app:prepareComAndroidSupportSupportFragment2501Library UP-TO-DATE
:app:prepareComAndroidSupportSupportMediaCompat2501Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42501Library UP-TO-DATE
:app:prepareComAndroidSupportSupportVectorDrawable2501Library UP-TO-DATE
:app:prepareComFacebookFbuiTextlayoutbuilderTextlayoutbuilder100Library UP-TO-DATE
:app:prepareComFacebookFrescoDrawee101Library UP-TO-DATE
:app:prepareComFacebookFrescoFbcore101Library UP-TO-DATE
:app:prepareComFacebookFrescoFresco101Library UP-TO-DATE
:app:prepareComFacebookFrescoImagepipeline101Library UP-TO-DATE
:app:prepareComFacebookFrescoImagepipelineBase101Library UP-TO-DATE
:app:prepareComFacebookFrescoImagepipelineOkhttp3101Library UP-TO-DATE
:app:prepareComFacebookReactReactNative0451Library UP-TO-DATE
:app:prepareComFacebookSoloaderSoloader010Library UP-TO-DATE
:app:prepareComGithubDroibitCustomtabslauncherLauncher108Library UP-TO-DATE
:app:prepareOrgWebkitAndroidJscR174650Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:bundleDebugJsAndAssets SKIPPED
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources
:app:generateDebugSources
:app:processDebugJavaRes UP-TO-DATE
:app:compileDebugJava UP-TO-DATE
:app:compileDebugNdk UP-TO-DATE
:app:compileDebugSources UP-TO-DATE
:app:preDexDebug UP-TO-DATE
:app:dexDebug UP-TO-DATE
:app:validateDebugSigning
:app:packageDebug
:app:zipalignDebug
:app:assembleDebug
:app:installDebug
Installing APK 'app-debug.apk' on 'Lenovo K53a48 - 6.0.1'
Installed on 1 device.
BUILD SUCCESSFUL
Total time: 1 mins 50.436 secs
Running adb -s a8b7e091 reverse tcp:8081 tcp:8081
Starting the app on a8b7e091 (adb -s a8b7e091 shell am start -n com.animatedapp/com.animatedapp.MainActivity)...
Starting: Intent { cmp=com.animatedapp/.MainActivity }
完成后,它断开连接,如果需要在文件中进行一些更改,而不是再次运行bundle命令,而不是再次运行react-native run-android。我怎么能解决这个问题。为什么我需要一次又一次地运行这个命令。