- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我有一个使用 CLLocationManager
的 iOS5 iPad 应用程序,我正在使用 UIAutomation
进行测试。
在运行测试脚本之前,我在使用 CLLocationManager 时在 iOS 显示的对话框中手动按下“确定”。
有时,我的测试脚本会无法启动。我按下 Instruments
中的“播放”图标,12 秒内没有任何反应。然后,我得到以下异常:
Target app is not frontmost
一旦发生这种情况,我通常必须重新启动才能让仪器再次工作。
当我离开我的应用程序前面的 CLLocationManager
对话框时,我曾经遇到过同样的异常。有人知道如何解决这个问题吗?
最佳答案
//Handling Externally Generated Alerts
UIATarget.onAlert = function onAlert(alert) {
var title = alert.name();
UIALogger.logWarning("Alert with title ’" + title + "’ encountered!");
if (title == "Add Something") {
alert.buttons()["Add"].tap();
return true; // bypass default handler
}
return false; // use default handler
}
Use this code to handle location alert
关于ios - UIAutomation 仪器异常 "Target app is not frontmost",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8680997/
在我看来,这些情况都是平行的: 我的 View Controller 显示了另一个全屏 View Controller ,现在已关闭 我的 View Controller 显示了另一个非全屏 View
早些时候我使用 spring board 框架来获取最前面的应用程序,它在 ios7 之前工作正常,但在 iOS8 中。我没有得到最前面的应用程序名称。我正在使用这段代码。 #define SBSER
我有一个使用 CLLocationManager 的 iOS5 iPad 应用程序,我正在使用 UIAutomation 进行测试。 在运行测试脚本之前,我在使用 CLLocationManager
我正在使用 Xcode 5.0 版并尝试使用工具,当我运行包含“var target = UIATarget.localTarget();”的脚本时 出现以下错误:“无法启动脚本,目标应用程序不是最前
在 iOS 7 及更早版本中,如果我们想在应用程序中找到 topMostWindow,我们通常使用以下代码行 [[[UIApplication sharedApplication] windows]
我是一名优秀的程序员,十分优秀!