Could not run adb Reverse:command failed:

Source: Internet
Author: User

https://stackoverflow.com/questions/31525431/getting-error-closed-twice-on-adb-reverse/31526946

Since is not adb reverse supported in Android versions lower than 5.0, you need to use a alternative method, for example Connec Ting via Wi-Fi instead. If you is using React Native, Facebook has added official documentation to connect to the development server via Wi-Fi. Quoting the instructions for MacOS, but they also has them for Linux and Windows:

Method 2:connect via Wi-Fi

You can also connect to the development server over Wi-Fi. You'll first need to install the app on your device using a USB cable but once that have been done can debug Wirelessl Y by following these instructions. You'll need your development machine's current IP address before proceeding.

You can find the IP address in System preferences→network.

Make sure your laptop and your phone is on the same Wi-Fi network. Open your React Native app on your device. You'll see a red screen with an error. This is OK. The following steps would fix that. Open the In-app Developer menu. Go to Dev settings→debug server host for device. Type in your machine ' s IP address and the port of the local dev server (e.g. 10.0.1.1:8081). Go back to the Developer menu and select Reload JS.

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 would create in the index.android.bundle assets folder

    4. Run:

      npm react-native run-android

Now your can get apk in the build folder which would work fine.

Could not run adb Reverse:command failed:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.