Skip to content

albinstman/tinyios

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tinyios

Go Report Card GitHub release (latest SemVer)


tinyios is cross platform software to talk to ios devices over usb or wifi. It mimics a small set of features that can be done via xcode, developer tools and system settings on a mac.

It exposes itself as a HTTP server so it can be accessed from anywhere. It is also stateless and rootless which makes it easy to run as an ephemeral container.

tinyios depends on usbmuxd installed on the host machine to manage device pairing and device communication through usb or wifi. You will also need to make usbmuxd on the host available inside the container.


Installation

WSL

  1. Forward device to WSL

  2. Install dependancies

    To use tinyios on Linux or WSL you need to install usbmuxd to handle device pairing and device communication. You can run these commands to install or update existing usbmuxd to the latest version

    git clone https://github.com/libimobiledevice/usbmuxd.git
    cd usbmuxd
    ./autogen.sh
    make
    sudo make install
    

    You will also need socat to make usbmuxd available from the host to container

    sudo apt install socat
    sudo socat TCP-LISTEN:27015,reuseaddr,fork UNIX-CONNECT:/var/run/usbmuxd
    
  3. Run latest container image on port 8080

    docker run —rm \
    -p 8080:8080 \
    -e USBMUXD_SOCKET_ADDRESS=host.docker.internal:27015 \
    albinstman/tinyios
    

Linux

  1. Install dependancies

    To use tinyios on Linux or WSL you need to install usbmuxd to handle device pairing and device communication. You can run these commands to install or update existing usbmuxd to the latest version

    git clone https://github.com/libimobiledevice/usbmuxd.git
    cd usbmuxd
    ./autogen.sh
    make
    sudo make install
    

    You will also need socat to make usbmuxd available from the host to container

    sudo apt install socat
    sudo socat TCP-LISTEN:27015,reuseaddr,fork UNIX-CONNECT:/var/run/usbmuxd
    
  2. Run latest container image on port 8080

    docker run —rm \
    -p 8080:8080 \
    -e USBMUXD_SOCKET_ADDRESS=host.docker.internal:27015 \
    albinstman/tinyios
    

Mac

  1. Make usbmuxd available for container
    brew install socat
    socat TCP-LISTEN:27015,reuseaddr,fork UNIX-CONNECT:/var/run/usbmuxd
    
  2. Run latest container image on port 8080
    docker run —rm \
    -p 8080:8080 \
    -e USBMUXD_SOCKET_ADDRESS=host.docker.internal:27015 \
    albinstman/tinyios
    

Purpose

The main purpose of tinyios is to setup ios devices and then talk to them via appium webdriver commands.


All endpoints

activation

Method URI Name Summary
GET /{udid}/activated get udid activated Check activation status
POST /{udid}/activate/enable post udid activate enable Enable activation

apps

Method URI Name Summary
GET /{udid}/apps/list get udid apps list List applications
POST /{udid}/apps/install post udid apps install Install application
POST /{udid}/apps/kill post udid apps kill Kill application
POST /{udid}/apps/run post udid apps run Run application

developer

Method URI Name Summary
GET /{udid}/devmode get udid devmode Check developer mode status
GET /{udid}/image get udid image Check developer disk image status
POST /{udid}/devmode/enable post udid devmode enable Enable developer mode
POST /{udid}/image/enable post udid image enable Mount developer disk image

device

Method URI Name Summary
GET /devices get devices List devices
GET /{udid}/processes get udid processes List processes
POST /{udid}/erase post udid erase Erase device
POST /{udid}/reboot post udid reboot Reboot device

pairing

Method URI Name Summary
GET /{udid}/paired get udid paired Check pairing status
POST /{udid}/pair/enable post udid pair enable Enable pairing

profiles

Method URI Name Summary
GET /{udid}/profiles/list get udid profiles list List profiles
POST /{udid}/profiles/add post udid profiles add Add profile

supervision

Method URI Name Summary
GET /{udid}/supervised get udid supervised Check supervision status
POST /{udid}/supervise/enable post udid supervise enable Enable supervision

wda

Method URI Name Summary
POST /{udid}/wda/kill post udid wda kill Kill WebDriverAgent
POST /{udid}/wda/run post udid wda run Run WebDriverAgent

Paths

List devices (GetDevices)

GET /devices

Returns a list of all connected iOS devices

Produces

  • application/json

All responses

Code Status Description Has headers Schema
200 OK OK schema

Responses

200 - OK

Status: OK

Schema

MainDevicesResponse

Check activation status (GetUdidActivated)

GET /{udid}/activated

Returns whether the device is activated

Produces

  • application/json

Parameters

Name Source Type Go type Separator Required Default Description
udid path string string Device UDID

All responses

Code Status Description Has headers Schema
200 OK OK schema

Responses

200 - OK

Status: OK

Schema

MainGenericResponse

List applications (GetUdidAppsList)

GET /{udid}/apps/list

Returns a list of applications installed on the device

Produces

  • application/json

Parameters

Name Source Type Go type Separator Required Default Description
udid path string string Device UDID

All responses

Code Status Description Has headers Schema
200 OK OK schema

Responses

200 - OK

Status: OK

Schema

MainGenericResponse

Check developer mode status (GetUdidDevmode)

GET /{udid}/devmode

Returns whether developer mode is enabled on the device

Produces

  • application/json

Parameters

Name Source Type Go type Separator Required Default Description
udid path string string Device UDID

All responses

Code Status Description Has headers Schema
200 OK OK schema

Responses

200 - OK

Status: OK

Schema

MainGenericResponse

Check developer disk image status (GetUdidImage)

GET /{udid}/image

Returns whether the developer disk image is mounted

Produces

  • application/json

Parameters

Name Source Type Go type Separator Required Default Description
udid path string string Device UDID

All responses

Code Status Description Has headers Schema
200 OK OK schema

Responses

200 - OK

Status: OK

Schema

MainGenericResponse

Check pairing status (GetUdidPaired)

GET /{udid}/paired

Returns whether the device is paired

Produces

  • application/json

Parameters

Name Source Type Go type Separator Required Default Description
udid path string string Device UDID

All responses

Code Status Description Has headers Schema
200 OK OK schema

Responses

200 - OK

Status: OK

Schema

MainGenericResponse

List processes (GetUdidProcesses)

GET /{udid}/processes

Returns a list of running processes on the device

Produces

  • application/json

Parameters

Name Source Type Go type Separator Required Default Description
udid path string string Device UDID

All responses

Code Status Description Has headers Schema
200 OK OK schema

Responses

200 - OK

Status: OK

Schema

MainGenericResponse

List profiles (GetUdidProfilesList)

GET /{udid}/profiles/list

Returns a list of configuration profiles installed on the device

Produces

  • application/json

Parameters

Name Source Type Go type Separator Required Default Description
udid path string string Device UDID

All responses

Code Status Description Has headers Schema
200 OK OK schema

Responses

200 - OK

Status: OK

Schema

MainGenericResponse

Check supervision status (GetUdidSupervised)

GET /{udid}/supervised

Returns whether the device is supervised

Produces

  • application/json

Parameters

Name Source Type Go type Separator Required Default Description
udid path string string Device UDID

All responses

Code Status Description Has headers Schema
200 OK OK schema

Responses

200 - OK

Status: OK

Schema

MainGenericResponse

Enable activation (PostUdidActivateEnable)

POST /{udid}/activate/enable

Activates the specified iOS device

Produces

  • application/json

Parameters

Name Source Type Go type Separator Required Default Description
udid path string string Device UDID

All responses

Code Status Description Has headers Schema
200 OK OK schema

Responses

200 - OK

Status: OK

Schema

MainGenericResponse

Install application (PostUdidAppsInstall)

POST /{udid}/apps/install

Installs an application from a URL on the device

Consumes

  • application/json

Produces

  • application/json

Parameters

Name Source Type Go type Separator Required Default Description
udid path string string Device UDID
request body MainAppInstallRequest models.MainAppInstallRequest Application IPA URL

All responses

Code Status Description Has headers Schema
200 OK OK schema
400 Bad Request invalid JSON schema

Responses

200 - OK

Status: OK

Schema

MainGenericResponse

400 - invalid JSON

Status: Bad Request

Schema

Kill application (PostUdidAppsKill)

POST /{udid}/apps/kill

Terminates a running application by process ID

Produces

  • application/json

Parameters

Name Source Type Go type Separator Required Default Description
udid path string string Device UDID
pid formData string string Process ID

All responses

Code Status Description Has headers Schema
200 OK OK schema

Responses

200 - OK

Status: OK

Schema

MainGenericResponse

Run application (PostUdidAppsRun)

POST /{udid}/apps/run

Launches an application on the device

Produces

  • application/json

Parameters

Name Source Type Go type Separator Required Default Description
udid path string string Device UDID
bundleid formData string string Application bundle identifier

All responses

Code Status Description Has headers Schema
200 OK OK schema

Responses

200 - OK

Status: OK

Schema

MainGenericResponse

Enable developer mode (PostUdidDevmodeEnable)

POST /{udid}/devmode/enable

Enables developer mode on the device

Produces

  • application/json

Parameters

Name Source Type Go type Separator Required Default Description
udid path string string Device UDID

All responses

Code Status Description Has headers Schema
200 OK OK schema

Responses

200 - OK

Status: OK

Schema

MainGenericResponse

Erase device (PostUdidErase)

POST /{udid}/erase

Erases all content and settings from the device

Produces

  • application/json

Parameters

Name Source Type Go type Separator Required Default Description
udid path string string Device UDID

All responses

Code Status Description Has headers Schema
200 OK OK schema

Responses

200 - OK

Status: OK

Schema

MainGenericResponse

Mount developer disk image (PostUdidImageEnable)

POST /{udid}/image/enable

Mounts the developer disk image on the device

Produces

  • application/json

Parameters

Name Source Type Go type Separator Required Default Description
udid path string string Device UDID

All responses

Code Status Description Has headers Schema
200 OK OK schema

Responses

200 - OK

Status: OK

Schema

MainGenericResponse

Enable pairing (PostUdidPairEnable)

POST /{udid}/pair/enable

Pairs the device using the provided certificate

Produces

  • application/json

Parameters

Name Source Type Go type Separator Required Default Description
udid path string string Device UDID

All responses

Code Status Description Has headers Schema
200 OK OK schema

Responses

200 - OK

Status: OK

Schema

MainGenericResponse

Add profile (PostUdidProfilesAdd)

POST /{udid}/profiles/add

Installs a configuration profile on the device

Consumes

  • application/json

Produces

  • application/json

Parameters

Name Source Type Go type Separator Required Default Description
udid path string string Device UDID
profile body MainProfileAddRequest models.MainProfileAddRequest Base64 encoded profile

All responses

Code Status Description Has headers Schema
200 OK OK schema
400 Bad Request invalid JSON schema

Responses

200 - OK

Status: OK

Schema

MainGenericResponse

400 - invalid JSON

Status: Bad Request

Schema

Reboot device (PostUdidReboot)

POST /{udid}/reboot

Reboots the specified iOS device

Produces

  • application/json

Parameters

Name Source Type Go type Separator Required Default Description
udid path string string Device UDID

All responses

Code Status Description Has headers Schema
200 OK OK schema

Responses

200 - OK

Status: OK

Schema

MainGenericResponse

Enable supervision (PostUdidSuperviseEnable)

POST /{udid}/supervise/enable

Prepares and enables supervision on the device

Produces

  • application/json

Parameters

Name Source Type Go type Separator Required Default Description
udid path string string Device UDID

All responses

Code Status Description Has headers Schema
200 OK OK schema

Responses

200 - OK

Status: OK

Schema

MainGenericResponse

Kill WebDriverAgent (PostUdidWdaKill)

POST /{udid}/wda/kill

Stops WebDriverAgent on the device

Produces

  • application/json

Parameters

Name Source Type Go type Separator Required Default Description
udid path string string Device UDID

All responses

Code Status Description Has headers Schema
200 OK OK schema

Responses

200 - OK

Status: OK

Schema

MainGenericResponse

Run WebDriverAgent (PostUdidWdaRun)

POST /{udid}/wda/run

Starts WebDriverAgent on the device

Produces

  • application/json

Parameters

Name Source Type Go type Separator Required Default Description
udid path string string Device UDID

All responses

Code Status Description Has headers Schema
200 OK OK schema

Responses

200 - OK

Status: OK

Schema

MainGenericResponse

Models

main.AppInstallRequest

Properties

Name Type Go type Required Default Description Example
url string string

main.Device

Properties

Name Type Go type Required Default Description Example
ConnectionType string string
ProductName string string
ProductType string string
ProductVersion string string
Udid string string

main.DevicesResponse

Properties

Name Type Go type Required Default Description Example
devices []MainDevice []*MainDevice

main.GenericResponse

Properties

Name Type Go type Required Default Description Example
ok boolean bool

main.ProfileAddRequest

Properties

Name Type Go type Required Default Description Example
b64profile string string

About

Talk to and manage ios devices

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages