Documentation ¶
Index ¶
- Constants
- func Activate(c *gin.Context)
- func CreateWdaSession(c *gin.Context)
- func DeleteWdaSession(c *gin.Context)
- func DeviceMiddleware() gin.HandlerFunc
- func DisableDeviceCondition(c *gin.Context)
- func EnableDeviceCondition(c *gin.Context)
- func GetImages(c *gin.Context)
- func GetProfiles(c *gin.Context)
- func GetSupportedConditions(c *gin.Context)
- func GetVersion() string
- func Info(c *gin.Context)
- func InstallApp(c *gin.Context)
- func InstallImage(c *gin.Context)
- func KillApp(c *gin.Context)
- func LaunchApp(c *gin.Context)
- func LimitNumClientsUDID() gin.HandlerFunc
- func List(c *gin.Context)
- func ListApps(c *gin.Context)
- func Listen(c *gin.Context)
- func Main()
- func MustMarshal(v interface{}) string
- func MyLogger(logger logrus.FieldLogger, notLogged ...string) gin.HandlerFunc
- func Notifications(c *gin.Context)
- func PairDevice(c *gin.Context)
- func ReadWdaSession(c *gin.Context)
- func ResetLocation(c *gin.Context)
- func Screenshot(c *gin.Context)
- func SetLocation(c *gin.Context)
- func StreamingHeaderMiddleware() gin.HandlerFunc
- func Syslog(c *gin.Context)
- func UninstallApp(c *gin.Context)
- type GenericResponse
- type WdaConfig
- type WdaSession
- type WdaSessionKey
Constants ¶
const IOS_KEY = "go_ios_device"
Variables ¶
This section is empty.
Functions ¶
func Activate ¶
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 CreateWdaSession ¶
@Summary Create a new WDA session @Description Create a new WebDriverAgent session for the specified device @Tags WebDriverAgent @Accept json @Produce json @Param config body WdaConfig true "WebDriverAgent Configuration" @Success 200 {object} WdaSession @Failure 400 {object} GenericResponse @Router /wda/session [post]
func DeleteWdaSession ¶
@Summary Delete a WebDriverAgent session @Description Delete a WebDriverAgent session by sessionId @Tags WebDriverAgent @Produce json @Param sessionId path string true "Session ID" @Success 200 {object} WdaSession @Failure 400 {object} GenericResponse @Router /wda/session/{sessionId} [delete]
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 ¶
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 ¶
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 GetProfiles ¶
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 ¶
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 ¶
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 InstallApp ¶
Install app on a device @Summary Install app on a device @Description Install app on a device by uploading an ipa file @Tags apps @Produce json @Param file formData file true "ipa file to install" @Success 200 {object} GenericResponse @Failure 500 {object} GenericResponse @Router /device/{udid}/apps/install [post]
func InstallImage ¶
func KillApp ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 MustMarshal ¶
func MustMarshal(v interface{}) string
func MyLogger ¶
func MyLogger(logger logrus.FieldLogger, notLogged ...string) gin.HandlerFunc
taken from https://github.com/toorop/gin-logrus/blob/master/logger.go
func Notifications ¶
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 ¶
======================================== 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 ReadWdaSession ¶
@Summary Get a WebDriverAgent session @Description Get a WebDriverAgent session by sessionId @Tags WebDriverAgent @Produce json @Param sessionId path string true "Session ID" @Success 200 {object} WdaSession @Failure 400 {object} GenericResponse @Router /wda/session/{sessionId} [get]
func ResetLocation ¶
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 ¶
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 ¶
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 ¶
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]
func UninstallApp ¶
Uninstall app on a device @Summary Uninstall app on a device @Description Uninstall 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
Types ¶
type GenericResponse ¶
type WdaSession ¶
type WdaSessionKey ¶
type WdaSessionKey struct {
// contains filtered or unexported fields
}