Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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,

like image 846
DarkRainbow Avatar asked Feb 17 '14 12:02

DarkRainbow


2 Answers

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}});
like image 138
dorit Avatar answered Nov 08 '22 05:11

dorit


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

like image 36
just_a_programmer Avatar answered Nov 08 '22 07:11

just_a_programmer