api

package
v0.0.0-...-ac4e40b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 29, 2024 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const IOS_KEY = "go_ios_device"

Variables

This section is empty.

Functions

func Activate

func Activate(c *gin.Context)

Activate activates the device. Devices need to be activated and contact Apple servers before they can be used. Info godoc @Summary Activate the device by udid @Description Returns and error if activation fails. Otherwise {"message":"Activation successful"} @Tags general_device_specific, activation @Produce json @Success 200 {object} map[string]interface{} @Param udid path string true "Device UDID" @Router /device/{udid}/activate [post]

func DeviceMiddleware

func DeviceMiddleware() gin.HandlerFunc

DeviceMiddleware makes sure a udid was specified and that a device with that UDID is connected with the host. Will return 404 if the device is not found or 500 if something else went wrong. Use `device := c.MustGet(IOS_KEY).(ios.DeviceEntry)` to acquire the device in downstream handlers.

func DisableDeviceCondition

func DisableDeviceCondition(c *gin.Context)

Disable the currently active condition on a device @Summary Disable the currently active condition on a device @Description Disable the currently active condition on a device @Tags general_device_specific @Produce json @Success 200 {object} GenericResponse @Failure 500 {object} GenericResponse @Param udid path string true "Device UDID" @Router /device/{udid}/disable-condition [post]

func EnableDeviceCondition

func EnableDeviceCondition(c *gin.Context)

Enable condition on a device @Summary Enable condition on a device @Description Enable condition on a device by provided profileTypeID and profileID @Tags general_device_specific @Produce json @Param udid path string true "Device UDID" @Param profileTypeID query string true "Identifier of the profile type, eg. SlowNetworkCondition" @Param profileID query string true "Identifier of the sub-profile, eg. SlowNetwork100PctLoss" @Success 200 {object} GenericResponse @Failure 500 {object} GenericResponse @Router /device/{udid}/enable-condition [put]

func GetImages

func GetImages(c *gin.Context)

func GetProfiles

func GetProfiles(c *gin.Context)

Get the list of installed profiles @Summary get the list of profiles @Description get the list of installed profiles from the ios device @Tags general_device_specific @Produce json @Success 200 {object} map[string]interface{} @Failure 500 {object} GenericResponse @Failure 404 {object} GenericResponse @Param udid path string true "Device UDID" @Router /device/{udid}/profiles [get]

func GetSupportedConditions

func GetSupportedConditions(c *gin.Context)

Get a list of the available conditions that can be applied on the device @Summary Get a list of available device conditions @Description Get a list of the available conditions that can be applied on the device @Tags general_device_specific @Produce json @Success 200 {object} []instruments.ProfileType @Failure 500 {object} GenericResponse @Param udid path string true "Device UDID" @Router /device/{udid}/conditions [get]

func GetVersion

func GetVersion() string

GetVersion reads the contents of the file version.txt and returns it. If the file cannot be read, it returns "could not read version"

func Info

func Info(c *gin.Context)

Info gets device info Info godoc @Summary Get lockdown info for a device by udid @Description Returns all lockdown values and additional instruments properties for development enabled devices. @Tags general_device_specific @Produce json @Param udid path string true "device udid" @Success 200 {object} map[string]interface{} @Param udid path string true "Device UDID" @Router /device/{udid}/info [get]

func InstallImage

func InstallImage(c *gin.Context)

func KillApp

func KillApp(c *gin.Context)

Kill running app on a device @Summary Kill running app on a device @Description Kill running app on a device by provided bundleID @Tags apps @Produce json @Param bundleID query string true "bundle identifier of the targeted app" @Success 200 {object} GenericResponse @Failure 500 {object} GenericResponse @Router /device/{udid}/apps/kill [post]

func LaunchApp

func LaunchApp(c *gin.Context)

Launch app on a device @Summary Launch app on a device @Description Launch app on a device by provided bundleID @Tags apps @Produce json @Param bundleID query string true "bundle identifier of the targeted app" @Success 200 {object} GenericResponse @Failure 500 {object} GenericResponse @Router /device/{udid}/apps/launch [post]

func LimitNumClientsUDID

func LimitNumClientsUDID() gin.HandlerFunc

LimitNumClientsUDID limits clients to one concurrent connection per device UDID at a time

func List

func List(c *gin.Context)

List get device list of currently connected devices. List godoc @Summary Get device list @Description get device list of currently connected devices. @Tags general @Produce json @Success 200 {object} map[string]interface{} @Router /list [get]

func ListApps

func ListApps(c *gin.Context)

List apps on a device @Summary List apps on a device @Description List the installed apps on a device @Tags apps @Produce json @Success 200 {object} []installationproxy.AppInfo @Failure 500 {object} GenericResponse @Router /device/{udid}/apps [post]

func Listen

func Listen(c *gin.Context)

Listen send server side events when devices are plugged in or removed Listen godoc @Summary Uses SSE to connect to the LISTEN command @Description Uses SSE to connect to the LISTEN command @Tags general @Produce json @Success 200 {object} map[string]interface{} @Router /listen [get]

func Main

func Main()

func MustMarshal

func MustMarshal(v interface{}) string

func Notifications

func Notifications(c *gin.Context)

Notifications uses instruments to get application state change events. It will stream the events as json objects separated by line breaks until it errors out. Listen godoc @Summary uses instruments to get application state change events @Description uses instruments to get application state change events @Tags general @Produce json @Success 200 {object} map[string]interface{} @Router /notifications [get]

func PairDevice

func PairDevice(c *gin.Context)

======================================== DEVICE PAIRING ======================================== Pairs a device @Summary Pair a device with/without supervision @Description Pair a device with/without supervision @Tags general_device_specific @Produce json @Success 200 {object} GenericResponse @Failure 500 {object} GenericResponse @Failure 422 {object} GenericResponse @Param udid path string true "Device UDID" @Param supervised query string true "Set if device is supervised - true/false" @Param p12file formData file false "Supervision *.p12 file" @Param supervision_password formData string false "Supervision password" @Router /device/{udid}/pair [post]

func ResetLocation

func ResetLocation(c *gin.Context)

Reset to the actual device location @Summary Reset the changed device location @Description Reset the changed device location to the actual one @Tags general_device_specific @Produce json @Success 200 @Failure 500 {object} GenericResponse @Param udid path string true "Device UDID" @Router /device/{udid}/resetlocation [post]

func Screenshot

func Screenshot(c *gin.Context)

Screenshot grab screenshot from a device Screenshot godoc @Summary Get screenshot for device @Description Takes a png screenshot and returns it. @Tags general_device_specific @Produce png @Param udid path string true "device udid" @Success 200 {object} []byte @Param udid path string true "Device UDID" @Router /device/{udid}/screenshot [get]

func SetLocation

func SetLocation(c *gin.Context)

Change the current device location @Summary Change the current device location @Description Change the current device location to provided latitude and longtitude @Tags general_device_specific @Produce json @Param latitude query string true "Location latitude" @Param longtitude query string true "Location longtitude" @Success 200 {object} GenericResponse @Failure 422 {object} GenericResponse @Failure 500 {object} GenericResponse @Param udid path string true "Device UDID" @Router /device/{udid}/setlocation [post]

func StreamingHeaderMiddleware

func StreamingHeaderMiddleware() gin.HandlerFunc

StreamingHeaderMiddleware adds event-streaming headers

func Syslog

func Syslog(c *gin.Context)

Syslog Listen godoc @Summary Uses SSE to connect to the LISTEN command @Description Uses SSE to connect to the LISTEN command @Tags general @Produce json @Success 200 {object} map[string]interface{} @Router /listen [get]

Types

type GenericResponse

type GenericResponse struct {
	Message string `json:"message,omitempty"`
	Error   string `json:"error,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL