测试在"飞机"在Android模拟器模式 [英] Testing in "Airplane" mode in Android Emulator

查看:115
本文介绍了测试在"飞机"在Android模拟器模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想测试我的应用程序的情况下,当手机有没有互联网连接。

I'm trying to test my application for situations when the phone has no connection to the internet.

在我的模拟器,我在设置中打开飞行模式。但是,我的应用程序似乎仍然能够与我的服务器进行通信。它的工作原理是正常的。

In my emulator, I turned on Airplane Mode in the settings. However, my app still seemed to be able to communicate with my server. It works as normal.

在我的设备,同样的code抛出没有数据连接错误。

On my device, the same code throws an error with no data connection.

我怎样才能确保有在模拟器没有互联网连接,这样我就可以使用LogCat中等等来分析code。

How can I ensure that there is no internet connection in the emulator so I can use LogCat etc to analyze the code.

推荐答案

您可以关闭以pressing F8上网在模拟器

You can switch off Internet access by pressing F8 in the emulator

这篇关于测试在"飞机"在Android模拟器模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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