【发布时间】:2016-01-19 07:12:39
【问题描述】:
当我用
[[UIATarget localTarget].frontMostApp isVisible] 在 main.mm 主函数中,我得到异常说
* 异常 UIAutomation 在此设备上未启用。必须在“设置”中启用 UIAutomation。 *
但我已启用设置->开发人员->在设备中启用自动化 UI。 iOS 版本:8.1.2 和 8.0.1 越狱。
int main(int argc, char **argv, char **envp)
{
@autoreleasepool {
@try
{
[[UIATarget localTarget].frontMostApp isVisible];
if ([UIATarget localTarget].springboard.pid == nil)
{
return 0;
}
}
@catch (NSException *exception)
{
NSLog(@"*** exception %@ ***",exception);
return 0;
}
}
}
我已经看到了这个链接https://github.com/kif-framework/KIF/issues/707 和一些关于 UIATarget frontMostApp 的 Apple 参考文档,但到目前为止我还没有找到解决方案。
iOS版本有这个问题吗?我该如何解决这个问题?任何帮助表示赞赏。
【问题讨论】:
-
什么是调整应用程序?请提供更多细节。
-
@satheeshwaran 基本上,此调整应用程序的目标是启动应用程序并重复在同一应用程序上执行的操作,从特定目录读取包含先前执行操作的详细信息的文件。
-
请提供详细说明什么是调整应用程序的链接。
-
你的意思是什么是tweak?我猜它是为了处理UIAutomation.framework
-
嘿,基本上问题很简单,无论在设置中启用,当我调用 target.frontMostApp 时,我都会收到错误“UIAutomation not enabled in device”。
标签: ios ios-ui-automation tweak