ios - 使用 UI Automation 以编程方式打开/关闭真实 iOS 设备上的 wifi

标签 ios wifi ui-automation ios-ui-automation

我已经读过一两次,在真正的 iOS 设备(在我的例子中是 iPad)上使用 UI 自动化脚本打开/关闭 wifi 似乎是不可能的。

我还读到过您可以创建一个目标为“设置”的脚本,但它似乎只适用于模拟器,对吗?

您对我有什么想法或解决方案吗?

问候,

最佳答案

我能够这样做(只要确保您的目标应用程序在这样做时处于最重要的状态):

var target = UIATarget.localTarget();

target.dragFromToForDuration({x:0.1, y:557.00}, {x:211.00, y:206.00},
0.5); //to expose the actions panel on iOS

target.frontMostApp().mainWindow().elements()["Wifi"].tapWithOptions({tapOffset:{x:0.44, y:0.47}});

关于ios - 使用 UI Automation 以编程方式打开/关闭真实 iOS 设备上的 wifi,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21828552/

相关文章:

ios - 在标签栏 Controller 上使用导航栏

android - 在 Android 上实现位置跟踪

c# - 如何使用 MSAA 自动化简单的 Windows 窗体应用程序?

c# - 使用搜索条件作为 "OR"语句识别具有白色 UI 自动化的 WPF 控件

iphone - 有没有一种在 iOS 上使用 UIAutomation 来编写网络相关测试脚本的好方法

ios - Xcode Swift CocoaPods pod spec lint 在 Embed Pods 框架上失败

ios - RACObserve 不工作

objective-c - IOS 6 和 NSDateFormatter

android - 连接wifi时打开应用程序

linux - 在 EAP-PEAP 身份验证下从 WiFi 客户端提取 PMK,用于 Wireshark 分析