Programmatically turn on/off wifi on real iOS device with UI Automation

孤街醉人 提交于 2019-12-30 04:50:28

问题


I have already read once or twice that turn on/off wifi on a real iOS device (iPad in my case) with a UI Automation script seems not possible.

I've also read that you can create a script with the target "Settings" but it seems that it's only for simulators, am I right ?

Do you have any ideas or solutions for me ?

Regards,


回答1:


i was able to do so (just make sure you target application is on foremost state when doing so):

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}});



回答2:


To do this, like @Larme states, the user's iOS device must be jailbroken due to the locked-down nature of iOS.



来源:https://stackoverflow.com/questions/21828552/programmatically-turn-on-off-wifi-on-real-ios-device-with-ui-automation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!