UIATarget.setLocationWithOptions课程不适用

Pat*_*ini 15 javascript core-location ui-automation mapkit ios

我试图通过UI Automation自动化用户的路径.理想情况下,a中的用户位置MKMapView将根据我在自动化脚本中表达的路标列表进行更新:

var target = UIATarget.localTarget();

var waypoints = [
    {location: {latitude: 37.33170, longitude: -122.03020}, options: {course: 180}},
    {location: {latitude: 37.33170, longitude: -122.03022}, options: {course: 180}},
    {location: {latitude: 37.33170, longitude: -122.03025}, options: {course: 180}},
    {location: {latitude: 37.33170, longitude: -122.03027}, options: {course: 180}},
    {location: {latitude: 37.33170, longitude: -122.03030}, options: {course: 180}},
    {location: {latitude: 37.33170, longitude: -122.03032}, options: {course: 180}},
    {location: {latitude: 37.33170, longitude: -122.03035}, options: {course: 180}},
    {location: {latitude: 37.33170, longitude: -122.03037}, options: {course: 180}},
    {location: {latitude: 37.33170, longitude: -122.03040}, options: {course: 180}}
];

for (var waypointIndex = 0; waypointIndex < waypoints.length; waypointIndex++)
{
    if (waypointIndex == 0)
        target.delay(5);

    var waypoint = waypoints[waypointIndex];
    target.setLocationWithOptions(waypoint.location, waypoint.options);

    target.delay(1);

    if (waypointIndex == (waypoints.length - 1))
        waypointIndex = 0;
}
Run Code Online (Sandbox Code Playgroud)

位置部分应用没有问题,用户的指示器沿路径移动.但是,课程选项似乎没有做任何事情.我试过90,180,-90,3.14,和1.57作为选项值,但无济于事.

我也试过添加speed: 8参数options,没有任何变化.

看来这似乎是模拟标题唯一方法,并且该course选项完全有效且有文档记录,令人沮丧的是它不起作用.

烦人的hacky解决方法:如果你在物理设备上模拟位置(通过GPX文件),设备的旋转工作.这样您就可以模拟路线并获得旋转.

The*_*ude 2

像这样的坐标对我来说在仪器中有用:

{location:{longitude:2.105528,latitude:41.414359}, options:{speed:20, course: 290, altitude:200, horizontalAccuracy:10, verticalAccuracy:15}}
Run Code Online (Sandbox Code Playgroud)

尝试水平和垂直精度,甚至高度。

祝你好运!