-
-
Notifications
You must be signed in to change notification settings - Fork 318
Expand file tree
/
Copy pathcmd_device_location.go
More file actions
29 lines (22 loc) · 691 Bytes
/
Copy pathcmd_device_location.go
File metadata and controls
29 lines (22 loc) · 691 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package main
import (
"github.com/danielpaulus/go-ios/ios/instruments"
)
func runResetLocationCommand(ctx commandContext) {
resetLocation(ctx.Device)
}
func runSetLocationCommand(ctx commandContext) {
lat, _ := ctx.Args.String("--lat")
lon, _ := ctx.Args.String("--lon")
if ctx.Device.SupportsRsd() {
server, err := instruments.NewLocationSimulationService(ctx.Device)
exitIfError("failed to create location simulation service:", err)
startLocationSimulation(server, lat, lon)
return
}
setLocation(ctx.Device, lat, lon)
}
func runSetLocationGPXCommand(ctx commandContext) {
gpxFilePath, _ := ctx.Args.String("--gpxfilepath")
setLocationGPX(ctx.Device, gpxFilePath)
}