• <legend id='exwlg'><style id='exwlg'><dir id='exwlg'><q id='exwlg'></q></dir></style></legend>

    <tfoot id='exwlg'></tfoot>
  • <small id='exwlg'></small><noframes id='exwlg'>

  • <i id='exwlg'><tr id='exwlg'><dt id='exwlg'><q id='exwlg'><span id='exwlg'><b id='exwlg'><form id='exwlg'><ins id='exwlg'></ins><ul id='exwlg'></ul><sub id='exwlg'></sub></form><legend id='exwlg'></legend><bdo id='exwlg'><pre id='exwlg'><center id='exwlg'></center></pre></bdo></b><th id='exwlg'></th></span></q></dt></tr></i><div id='exwlg'><tfoot id='exwlg'></tfoot><dl id='exwlg'><fieldset id='exwlg'></fieldset></dl></div>

        • <bdo id='exwlg'></bdo><ul id='exwlg'></ul>
      1. 使用 Android 模拟器进行远程调试

        时间:2023-08-29
        • <tfoot id='zuX3H'></tfoot>

            <small id='zuX3H'></small><noframes id='zuX3H'>

              <tbody id='zuX3H'></tbody>

            1. <i id='zuX3H'><tr id='zuX3H'><dt id='zuX3H'><q id='zuX3H'><span id='zuX3H'><b id='zuX3H'><form id='zuX3H'><ins id='zuX3H'></ins><ul id='zuX3H'></ul><sub id='zuX3H'></sub></form><legend id='zuX3H'></legend><bdo id='zuX3H'><pre id='zuX3H'><center id='zuX3H'></center></pre></bdo></b><th id='zuX3H'></th></span></q></dt></tr></i><div id='zuX3H'><tfoot id='zuX3H'></tfoot><dl id='zuX3H'><fieldset id='zuX3H'></fieldset></dl></div>
              <legend id='zuX3H'><style id='zuX3H'><dir id='zuX3H'><q id='zuX3H'></q></dir></style></legend>

                <bdo id='zuX3H'></bdo><ul id='zuX3H'></ul>

                  本文介绍了使用 Android 模拟器进行远程调试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  是否可以在一台机器上编写代码/编译 Android 应用程序并在另一台机器上启动的模拟器上远程调试它?我厌倦了模拟器不断消耗笔记本电脑一半的 CPU.

                  Is it possible to write the code/compile Android application on one machine and debug it remotely on the emulator launched on another? I'm sick and tired of the emulator constantly eating half of my laptop's CPU.

                  推荐答案

                  我之前没有尝试过(甚至没有注意到)cmb 提到的 adb connect 命令,但我可以确认转发TCP 端口自己 -比如通过 SSH ——工作正常.

                  I haven't previously tried (or even noticed) the adb connect command that cmb mentioned, but I can confirm that forwarding the TCP ports yourself — such as over SSH — works fine.

                  模拟器在每个实例上侦听两个 TCP 端口:5554 用于 telnet 接口,5555 用于控制与 DDMS 等工具的通信.因此,您可能只需要转发端口 5555 就可以逃脱(尽管到目前为止我只尝试过两者).每个后续的模拟器都采用下一个可用的偶数+奇数端口号元组(我认为最多可达 5580 左右).

                  The emulator listens on two TCP ports per instance: 5554 for the telnet interface and 5555 for control communication with tools like DDMS. So you could probably get away with only forwarding port 5555 (though I've only tried it so far with both). Each subsequent emulator takes the next available even+odd port number tuple (up to around 5580, I think).

                  作为参考,我在本地机器上做了以下步骤:

                  For reference, I did the following steps on my local machine:

                  • ssh -NL 5554:localhost:5554 -L 5555:localhost:5555 myuser@remote-server
                  • killall adb;adb 设备

                  我相信模拟器会在启动时尝试通知本地 adb 服务器;因此需要重新启动 adb 才能探测本地 5554+ 端口.

                  I believe the emulator tries to notify a local adb server at startup; hence the need to restart adb in order for it to probe the local 5554+ ports.

                  注意ssh命令中的localhost指的是remote机器的本地接口.

                  Note that the localhost in the ssh command refers to the local interface of the remote machine.

                  adb devices 展示了一个新的模拟器 —emulator-5554 —我可以像在本地机器上运行一样使用它.

                  adb devices showed a new emulator — emulator-5554 — and I could use it as if it were running on my local machine.

                  这篇关于使用 Android 模拟器进行远程调试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:Android模拟器分配内存失败8 下一篇:安卓:未知主机异常

                  相关文章

                  最新文章

                  <tfoot id='0Kuxn'></tfoot>

                  <legend id='0Kuxn'><style id='0Kuxn'><dir id='0Kuxn'><q id='0Kuxn'></q></dir></style></legend>

                      <i id='0Kuxn'><tr id='0Kuxn'><dt id='0Kuxn'><q id='0Kuxn'><span id='0Kuxn'><b id='0Kuxn'><form id='0Kuxn'><ins id='0Kuxn'></ins><ul id='0Kuxn'></ul><sub id='0Kuxn'></sub></form><legend id='0Kuxn'></legend><bdo id='0Kuxn'><pre id='0Kuxn'><center id='0Kuxn'></center></pre></bdo></b><th id='0Kuxn'></th></span></q></dt></tr></i><div id='0Kuxn'><tfoot id='0Kuxn'></tfoot><dl id='0Kuxn'><fieldset id='0Kuxn'></fieldset></dl></div>

                      <small id='0Kuxn'></small><noframes id='0Kuxn'>

                        <bdo id='0Kuxn'></bdo><ul id='0Kuxn'></ul>