Android 使用模拟器远程调试
来源:互联网 发布:anywhere2 mac 编辑:程序博客网 时间:2024/05/12 22:00
方法1
By hheimbuerger
Here is how I solved it on Windows. I pretty much followed Christopher's lead, but I can't edit, so a new answer will have to do.
The problem I had was that ADB as well as the emulator was just listening on 127.0.0.1, not 0.0.0.0, for me. Otherwise I would have usedTCPMon. I guess this is either different on Windows, or has changed with the latest versions of the SDK. (You can check withnetstat -ban
.)
I installed WinSSHD on the machine that runs the emulator. (I believe it should work with freeSSHd as well, but I couldn't get a login working there.)
I opened port 22 (TCP) in the Windows Firewall. (WinSSHD might be able to do that for you.)
I created a virtual account in the WinSSHD GUI.
I created a new PuTTY connection from the development machine to the emulator machine and made sure I could connect.
Then I set up tunnelling in PuTTY: Connection -> SSH -> Tunnels
Source port: 5554
Destination: localhost:5554
Type: Local/Auto
Source port: 5555
Destination: localhost:5555
Type: Local/Auto
(Connect and keep PuTTY open, to maintain the tunnel.)
Now I fired up the emulator on the remote machine and made sure that ADB is not running there.
I restarted ADB on the development machine (
adb kill-server
, thenadb start-server
).adb devices
and the remote emulator showed up asemulator-5554 device
. I could now deploy and run my app straight from Eclipse/ADT, where the emulator showed up under Virtual Devices as if it was a local emulator.
By Patrick McKinnon
I realize this question is really old, but I solved the problem slightly differently, and it took me a while to figure out this trivial solution.
I usually use a Windows7 PC or laptop (depending on where I'm working) as my front-end because I like the GUI, however I prefer to do all of my edit/compile/debug on a headless Ubuntu server because of all the command-line power it provides. My goal is to make each windows system as much of a thin-client as possible without any extra services (such as sshd) or firewall holes.
So here is the senario:
- System-A: Windows7 system with android emulator running
- System-B: Ubuntu server with SDK installed
The problem as described earlier is that the emulator on System-A binds to localhost, not the external ethernet interface, so adb on the System-B cannot access the emulator on System-A. All you need to do is set up remote port forwarding in PuTTY for your SSH connection to System-B. The trick is to check the "Remote" radio button when you create the two tunnels so that the tunnel direction is reversed (tunneling from the server you are logging into to the client you are logging in from).
Finally, connect with adb to "localhost" on System-B after establishing the SSH connection:
System-B$ adb connect localhostconnected to localhost:5555System-B$ adb devicesList of devices attachedlocalhost:5555 device
Now you can download images/debug as normal, and it is a trivial matter to switch to a different Windows system if you want to take your laptop out and get some coffee.
In addition, by also tunneling port 5037 in the same manner you can actually forward your adb server connection so that you can connect a real android device over USB on System-A, and download images to it from System-B. In order for this to work, you need to make sure that the adb server is running on System-A, and not running on System-B before starting your SSH session:
First, start the adb server on System-A (command prompt)
C:\> adb start-server* daemon not running. starting it now on port 5037 ** daemon started successfully *C:\> adb devicesList of devices attached3435F6E6035B00EC device
Next, kill the adb server on System-B
System-B$ adb kill-server
Finally, restart your ssh session to System-B and verify
System-B$ adb devicesList of devices attached3435F6E6035B00EC device
- Android 使用模拟器远程调试
- 使用GDB调试android模拟器
- Android dab远程调试使用
- android 使用adb远程调试
- 推荐使用BlueStacks模拟器调试Android应用
- 如何使用天天模拟器调试Android程序
- Android 使用 YouWave 模拟器 进行程序调试
- 使用Android模拟器调试串口功能
- 远程连接BlueStacks模拟器调试
- Mac模拟器进行远程调试
- Android模拟器全屏调试
- 【Android 开发入门】使用Android模拟器预览调试程序
- Android使用WIFI进行远程ADB调试
- 使用IDA远程调试Android文件
- 远程调试 Android 设备使用入门1
- 远程调试 Android 设备使用入门
- Windows CE 模拟器和远程调试工具
- 模拟器和远程调试工具(二)
- 数据结构基础-哈希表
- opencv之读取图像
- 2D手机游戏的即时阴影效果
- VC# ASP.NET GridView1数据导出
- 2011-8-26
- Android 使用模拟器远程调试
- Android中修改设备权限
- GNU/Linux系统到底能做什么?能替代windows吗?(吐血推荐)
- 为什么在fonts文件夹菜单中没有“安装新字体”选项
- Java基于Socket文件传输示例
- 近况总结
- 在blend模式下使用telerik控件右击树的子项弹出menu浮层如何得到右击的子项
- ABAP制作密码输入框
- 将客户端图片保存到数据库中的方法