REGRESSION UIAutomation UIATarget setLocation does not work on iOS 7.0 and iOS 8.0 when target is a physical device

Originator:joshuajmoody
Number:rdar://17838015 Date Originated:29-Jul-2014 04:13 AM
Status:Open Resolved:
Product:Instruments Product Version:Instruments 5.1.1, 6.0
Classification:Serious Bug Reproducible:Always
 
Summary:
I am trying to use the UIAutomation JavaScript API to set the location of my device.

On iOS 6, I am able to use the UIATarget.setLocation function.

On iOS 7 and iOS 8, the function returns true, but does not update the device's location.

I used the sample project LocateMe to demonstrate.[1]  This example is not ideal, because it makes calls to several deprecated APIs and does not run (well) on iOS 8.  However, it exhibits the same behavior as the the app that I am currently working on and has the advantage of being public.

I have attached 2 videos:  one for iOS 6 demonstrating the expected behavior and one for iOS 7 demonstrating the unexpected behavior.  I tried to capture an iOS 8 video, but when I launched the app with Instruments 6, the ui was unresponsive.

[1] https://developer.apple.com/Library/ios/samplecode/LocateMe/Introduction/Intro.html

Steps to Reproduce:
1. download LocateMe from the sample projects
2. target an iOS 6 device, then build and run
3. touch the 'track location' tab and confirm your location can be found.
4. close the app
5. start Instruments 5.1.1 and select the UIAutomation template
6. target the LocateMe on iOS 6 device
7. from the Script editor run with the boilerplate code (var = ...)
8. repeat step 3
9. in the Script editor, paste the following:

var target = UIATarget.localTarget();
var success = target.setLocation({"latitude":37.78358,"longitude":-122.4008});
target.delay(0.2);
if (success) {
	UIALogger.logPass("location changed");	
} else {
	UIALogger.logFail("location did not change");
}

10. execute the script
10.1 repeat with an iOS 7 device using Instruments 5.1.1
10.2 repeat with an iOS 7 device using Instruments 6.0
10.3 repeat with an iOS 8 (b4) device using Instruments 6.0


Expected Results:
To see the location of my device change to 37.78, -122,40.

Actual Results:
On iOS 6, my device location changed.

On iOS 7 + Instruments 5.1.1, my device location did not change.
On iOS 7 + Instruments 6.0, my device location did not change.
On iOS 8 (b4) + Instruments 6.0, my device location did not change.


Version:
Version:
* OS X 10.9.4 (13E28)
* OS X 10.10 (14A298i)

Xcode 5.1.1
Instruments 5.1.1 (55045)

Xcode6-Beta4
Instruments 6.0 (56127.2)

iOS 6.14
iOS 7.1.2
iOS 8.0 b4

Notes:
* http://stackoverflow.com/questions/19115497/uiautomation-working-in-ios-6-but-not-in-ios-7-uiatarget-setlocationwithoptions
* https://github.com/calabash/calabash-ios/issues/377

Configuration:
Problem occurs on iOS 7 (Instruments 5.1.1 and 6.0) and iOS 8 (Instruments 6.0).

In Xcode 5.1.1 on iOS 6 and iOS 7 Simulators, UIATarget setLocation works.

In Xcode 6 b 4 on iOS 7 and iOS 8 Simulators, the LocateMe app never finds a location.

Attachments:
'iOS6-demo.mp4' and 'iOS7-demo.mp4' were successfully uploaded.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!