React Native adb reverse ENOENT

前端 未结 7 2152
悲&欢浪女
悲&欢浪女 2020-12-01 04:59

I am trying to get React-Native to work with Android V4.2.2 (Genymotion) but I am unable to test the app on the Emulator. When I ran react-native run-andr

7条回答
  •  情书的邮戳
    2020-12-01 05:30

    First I have setup the path in .bash_profile like this

    export PATH="~/Library/Android/sdk/platform-tools":$PATH
    export ANDROID_HOME="~/Library/Android/sdk/platform-tools"
    

    But it does not resolve my problem.

    For me by adding following npm script in package.json under script tag worked like charm on Mac.

    "android-dev": "adb reverse tcp:8081 tcp:8081 && react-native run-android"
    

    Then I am simply running npm run android-dev and it's all set. Make sure that in your app setting Live reload is enabled already, in this way I can worked on development server on my mobile and see the coding changes immediately in app.

提交回复
热议问题