Android 调试数据库无法访问站点 [英] Android debug database can't reach site
问题描述
我想使用 https://github.com/amitshekhariitbhu/Android-Debug-数据库库.
根据说明,我在 build.gradle 中添加了实现行 com.amitshekhar.android:debug-db:1.0.6
.使用默认模拟器,我开始调试,logcat正确显示消息DebugDB: Open http://10.0.2.16:8080 在您的浏览器中".在控制台中,我输入 adb forward tcp:8080 tcp:8080
尝试在笔记本电脑上的 url 上输入浏览器http://localhost:8080 以ERR_EMPTY_RESPONSE"结尾,甚至尝试输入 url http://10.0.2.16:8080 在模拟器浏览器中看起来是一样的.
According to the instructions I added to the build.gradle the implementation line com.amitshekhar.android:debug-db:1.0.6
.
Using the default emulator, I start debugging, logcat correctly displayed the message "DebugDB: Open http://10.0.2.16:8080 in your browser".
In the console I entered adb forward tcp:8080 tcp:8080
attempt to enter the browser on a laptop on url http://localhost:8080 ends with "ERR_EMPTY_RESPONSE", even the attempt to enter the url http://10.0.2.16:8080 in the emulator browser looks the same.
可能是什么问题?我使用的是 Windows 10.
What could be the problem? I'm using Windows 10.
推荐答案
我找到了适合我的案例的解决方案.只需按照 git [repo][1] 中的描述更改端口:
I found the solution for my case. Just change the port as described in git [repo][1]:
注意:如果您想使用 8080 以外的其他端口.在应用程序中buildTypes 下的 build.gradle 文件做如下改动
Note : If you want use different port other than 8080. In the app build.gradle file under buildTypes do the following change
调试{
resValue("string", "PORT_NUMBER", "8081")
}
它对我有用.[1]:https://github.com/amitshekhariitbhu/Android-Debug-Database
这篇关于Android 调试数据库无法访问站点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!