【问题标题】:How to run arp command on an android phone如何在安卓手机上运行 arp 命令
【发布时间】:2018-11-27 19:17:54
【问题描述】:

我已将三个摄像头连接到我的手机,我想知道它们的 IP 地址。在 windows 和 linux 中,它使用 arp 命令,但此命令不在 android 终端上运行。我怎样才能在 android 上运行 arp 命令,或者有其他方法可以达到同样的效果吗?

【问题讨论】:

    标签: android arp


    【解决方案1】:

    使用此代码为我工作。

    try {
            Process process = Runtime.getRuntime().exec("cat /proc/net/arp");
    
            BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
            String line;
            String output = "";
            while ((line = reader.readLine()) != null) {
                System.out.println(line);
            }
            reader.close();
            Log.d("*************", ""+output);
        }
        catch (IOException e) {
            e.printStackTrace();
            System.out.println(e);
        }
        return "";
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-04-10
      • 2011-11-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多