Getting “error: closed” twice on “adb reverse”

前端 未结 6 1096
走了就别回头了
走了就别回头了 2020-12-04 18:01

I am trying to reverse-forward port through ADB, but it just returns cryptic error of error: closed. Normal forwarding works. Session snippet:

$         


        
6条回答
  •  粉色の甜心
    2020-12-04 18:04

    Follow these steps carefully.

    Note: All commands need to run inside a project only.

    1. Run this command first:

      npm react-native start
      
    2. Open another window in the same project and run:

      curl "http://localhost:8081/index.android.bundle?platform=android" -o "android/app/src/main/assets/index.android.bundle"
      
    3. This will create index.android.bundle in the assets folder

    4. Run:

      npm react-native run-android
      

    Now you can get apk in the build folder which will work fine.

提交回复
热议问题