1

从 Windows 7 上的管理员命令提示符中,我输入:

C:\Program Files (x86)\Android\android-sdk\tools>emulator -avd Nexus -http-proxy localhost.:8888 -port 5554 -debug-proxy

我返回以下内容:

C:\Program Files (x86)\Android\android-sdk\tools>server name 'localhost.' resolved to 127.0.0.1:8888
proxy_http_setup: creating http proxy service connecting to: localhost.:8888
server name 'localhost.' resolved to 127.0.0.1:8888
proxy_http_setup: creating HTTP Proxy Service Footer is (len=2):
'
'
http_service_connect: trying to connect to (null)
http_service_connect: using HTTP rewriter
tcp:(null)(252): connecting
tcp:(null)(252): connected to http proxy, sending header
tcp:(null)(252): sending 27 bytes:
>> 43 4f 4e 4e 45 43 54 20 28 6e 75 6c 6c 29 20 48    CONNECT (null) H
>> 54 54 50 2f 31 2e 31 0d 0a 0d 0a                   TTP/1.1....

tcp:(null)(252): header sent, receiving first answer line
tcp:(null)(252): received 'HTTP/1.0 503'
tcp:(null)(252): connection refused, error=503
http_service_connect: trying to connect to (null)
http_service_connect: using HTTP rewriter
tcp:(null)(332): connecting
http_service_free

当我在模拟器中打开浏览器时,Charles 中有以下条目:

null:0
Failed
CONNECT request didn't include a port: (null)
HTTP/1.1
CONNECT
/127.0.0.1

如果我尝试使用我的 IP 地址,我会收到以下信息:

C:\Program Files (x86)\Android\android-sdk\tools>emulator -avd Nexus -http-proxy 192.234.2.90:8888 -debug-proxy

C:\Program Files (x86)\Android\android-sdk\tools>server name '192.xxx.2.xx' resolved to 192.xxx.2.xx:8888
emulator: Could not connect to proxy at 192.xxx.2.xx:8888: resource temporarily unavailable !
emulator: Proxy will be ignored !

如何针对 Android 模拟器正确运行 Charles?

我已经阅读了其他关于在模拟器运行时在设置中设置代理和端口的帖子,但是我在打开 -debug-proxy 时收到了类似的错误。

谢谢。

4

3 回答 3

1

这似乎是最新版本的 Android 开发工具 r12 的问题。

此错误报告表明从 r11 降级到模拟器二进制文件将解决该问题。转到Android SDK 下载页面,将您操作系统的 URL 中的“12”更改为“11”。将该 SDK 安装到与现有 SDK 不同的目录中,并使用该模拟器版本,直到 Google 解决问题。

于 2011-08-22T20:17:54.620 回答
0

就像其他人的更新一样,这个问题已在 r13 中得到解决

于 2011-09-26T05:18:09.057 回答
0

这是一个在 3.9 版本中已修复的错误。 http://www.charlesproxy.com/documentation/version-history/

于 2015-09-06T06:53:11.423 回答