谷歌的App Engine与Android - 在真实的设备测试端点 [英] Google App Engine with Android - testing endpoints on real device

查看:171
本文介绍了谷歌的App Engine与Android - 在真实的设备测试端点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在下面的教程从Android项目创建端点后端。一切都在编译和看起来很有希望。后端到了,我改变CloudEndpointUtils#LOCAL_ANDROID_RUN为真。但是当我试图测试在真实设备上的应用程序(而不是仿真器)IM上的失败 -

i've been following the tutorial in Creating an Endpoints Backend from an Android Project. Everything is compiling and looks promising. The backend is up, i changed CloudEndpointUtils#LOCAL_ANDROID_RUN to 'true'. but when i try to test the app on a real device (not emulator) im failing on -

java.net.SocketException异常:无法连接到/10.0.2.2 20000后(8888端口):isConnected失败:EHOSTUNREACH(没有到主机的路由)

java.net.SocketException: failed to connect to /10.0.2.2 (port 8888) after 20000ms: isConnected failed: EHOSTUNREACH (No route to host)

所以,我看着CloudEndpointUtils,看到设置LOCAL_ANDROID_RUN为真,使应用程序寻找DevAppServer在 http://10.0.2.2:8888 ,这是仿真虚拟路由器。 但林不使用模拟器。所以我试图改变常抱着这个网址为 http://127.0.0.1:8888/ ,但仍然没有运气。现在即时通讯的失败 -

So i looked at CloudEndpointUtils and saw that setting LOCAL_ANDROID_RUN to 'true' makes the app look for DevAppServer in http://10.0.2.2:8888, which is the emulator virtual router. but im not using the emulator. so i tried to change the constant holding this url to http://127.0.0.1:8888/ but still no luck. im now failing on -

java.net.ConnectException:无法连接到/127.0.0.1 20000后(8888端口):isConnected失败:ECONNREFUSED(连接被拒绝)

java.net.ConnectException: failed to connect to /127.0.0.1 (port 8888) after 20000ms: isConnected failed: ECONNREFUSED (Connection refused)

我想这可能是因为我的电脑在防火墙后面,所以我禁用它,但还是一无所获。

I thought it might be because my PC is behind a firewall, so i disabled it, but still nothing.

任何建议将AP preciated。

any suggestion would be appreciated.

推荐答案

添加

--address="0.0.0.0" 

作为应用引擎服务器地址参数 接受来自所有传入连接。

as the app engine server address parameter to accept from all incoming connections.

这篇关于谷歌的App Engine与Android - 在真实的设备测试端点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆