zoukankan      html  css  js  c++  java
  • react-native run-android error: unknown host service

    D: nworkspaceHello>react-native run-android

    JS server already running.
    Running D:Androidsdk/platform-tools/adb -s emulator-5554 reverse tcp:8081 tcp:
    8081
    Building and installing the app on the device (cd android && gradlew.bat install
    Debug)...

    Installing APK 'app-debug.apk' on 'emulator-5554 - 6.0'
    Installed on 1 device.


    BUILD SUCCESSFUL


    Total time: 39.532 secs
    Starting the app on emulator-5554 (D:Androidsdk/platform-tools/adb -s emulator
    -5554 shell am start -n com.hello/.MainActivity)...

    error: unknown host service

    解决

    adb无法使用,提示error:unknown host service的解决办法
    http://blog.csdn.net/liguilicsdn/article/details/50902194#comments
     
    此时,需要辨别电脑的5037端口被哪个应用程序占用的方法:(使用adb时需要5037端口是空闲的)
    如果5037端口被占用,找到他删掉进程OK。
    一般是360MobileLink.exe 这个软件。卸载掉360 手机助手即可!
     
    方法1 

    2.查看指定端口的占用情况
    C:>netstat -aon|findstr "9050"

      协议    本地地址                     外部地址               状态                   PID

      TCP    127.0.0.1:9050         0.0.0.0:0              LISTENING       2016

    P: 看到了吗,端口被进程号为2016的进程占用,继续执行下面命令: (也可以去任务管理器中查看pid对应的进程)

    3.查看PID对应的进程
    C:>tasklist|findstr "2016"

     映像名称                       PID 会话名              会话#       内存使用
     ========================= ======== ================
      tor.exe                     2016 Console                 0     16,064 K 

    P:很清楚吧,tor占用了你的端口。

     4.结束该进程

    C:>taskkill /f /t /im tor.exe

    方法2

    端口查看工具CurrPorts  
    官方下载地址 http://www.nirsoft.net/utils/cports.html  
    中文版下载地址 http://www.jb51.net/softjc/137217.html
  • 相关阅读:
    合理处理沉没成本
    推荐一个基于Ajax的查询API网站
    为blog添加天气预报功能
    我仅仅一个熟练的coder
    管理和IT的对话
    10个你未必知道的CSS技巧
    如何使用ajax开发web应用程序(二)
    5月20日,系分考试后感。
    说说大型高并发高负载网站的系统架构
    盗用sina的爱问投诉代码实现网页对话框。
  • 原文地址:https://www.cnblogs.com/simadi/p/7699016.html
Copyright © 2011-2022 走看看