Executar Teste iPerf
Executa um teste com servidor, protocolo, direção e temporização configuráveis. A duração padrão típica no fluxo de Shortcuts é de 5 segundos.
Documentação para desenvolvedores
Automatize verificações de throughput, validação de endpoints e coleta de resultados com ações integradas e endpoints de callback.
O iPerf3 Client & Server expõe duas camadas de automação:
Use iperf3cs://x-callback-url/... para automação baseada em callback.
Os requisitos atuais da plataforma Apple são iOS/iPadOS 16.6+, macOS 13.5+ e visionOS 1.0+.
Essas ações estão disponíveis diretamente no app Apple Shortcuts:
Executa um teste com servidor, protocolo, direção e temporização configuráveis. A duração padrão típica no fluxo de Shortcuts é de 5 segundos.
Retorna o resultado completo mais recente do histórico local.
Verifica a disponibilidade do endpoint antes de uma execução completa.
Retorna servidores configurados para automação orientada por menu.
Runs a test and returns the result through the callback URLs.
| Parâmetro | Tipo | Obrigatório | Descrição |
|---|---|---|---|
serverId | String | Não | Saved server to use: host:port, a server UUID, or default. Omit it and the default server is used. |
serverName | String | Não | Pick the server by its saved name instead of serverId. Takes precedence when both are present. |
autoAdd | Boolean | Não | Create the server if it is not in the library yet. addServer is accepted as an alias. |
durationSec | Integer | Não | Test length in seconds. Defaults to 5. |
protocol | String | Não | tcp (default) or udp. |
direction | String | Não | download, upload or bidirectional. |
streams | Integer | Não | Parallel stream count. |
bandwidthMbps | Number | Não | Target bandwidth for UDP tests, in Mbps. |
format | String | Não | json (default) or text. |
x-success | String | Não | Callback URL. Receives result with the payload, or resultRef when the payload is too large to pass in a URL. |
x-error | String | Não | Callback URL. Receives errorCode and errorMessage. |
x-cancel | String | Não | Callback URL for a cancelled run. |
Returns the most recent saved result. Useful for periodic logging.
| Parâmetro | Tipo | Obrigatório | Descrição |
|---|---|---|---|
serverId | String | Não | Limit the lookup to one server: host:port, a UUID, or default. Omit it for the latest result overall. |
serverName | String | Não | Same lookup by saved name. Takes precedence over serverId. |
format | String | Não | json (default) or text. |
x-success | String | Não | Callback URL. Receives result with the payload, or resultRef when the payload is too large to pass in a URL. |
x-error | String | Não | Callback URL. Receives errorCode and errorMessage. |
x-cancel | String | Não | Callback URL for a cancelled run. |
Fetches a payload the app handed back as a reference. When a result is too large for a callback URL, the app returns <code>resultRef</code> instead of <code>result</code>, and this endpoint exchanges that reference for the full payload.
| Parâmetro | Tipo | Obrigatório | Descrição |
|---|---|---|---|
resultRef | String | Sim | Reference returned earlier in place of result. |
format | String | Não | json (default) or text. |
x-success | String | Não | Callback URL. Receives result with the payload, or resultRef when the payload is too large to pass in a URL. |
x-error | String | Não | Callback URL. Receives errorCode and errorMessage. |
x-cancel | String | Não | Callback URL for a cancelled run. |
iperf3cs://x-callback-url/run-test?serverId=iperf.example.com:5201&autoAdd=1&protocol=tcp&direction=download&durationSec=8&format=json&x-success=shortcuts://run-shortcut?name=StoreResult iperf3cs://x-callback-url/get-last-result?format=json&x-success=shortcuts://run-shortcut?name=PushSummary open "iperf3cs://x-callback-url/run-test?serverId=10.0.1.5:5201&protocol=udp&direction=bidirectional&durationSec=5" {
"success": true,
"startTime": "2026-08-21T09:42:02Z",
"endTime": "2026-08-21T09:42:10Z",
"duration": 8,
"receivedMegabitsPerSecond": 942.7,
"sentMegabitsPerSecond": 876.4,
"receivedBytes": 942700000,
"summaryText": "942.7 Mbps down, 876.4 Mbps up"
} Quando uma ação falha e x-error está presente, o callback recebe um objeto de erro.
| Código | Descrição |
|---|---|
| invalidParameter | A parameter is missing, malformed or out of range. |
| serverNotFound | No saved server matched the lookup, and autoAdd was not set. |
| networkUnavailable | The device has no usable network path to the endpoint. |
| connectionTimeout | The connection or the test exceeded its timeout. |
| testFailed | The test started and ended without a usable result. |
| cancelled | The run was cancelled before it finished. |
| requiresAppOpen | The action needs the app in the foreground. |
| unsupportedOnOSVersion | The action is not available on this OS version. |
{
"errorCode": "serverNotFound",
"errorMessage": "No saved server matches iperf.example.com:5201"
} Certifique-se de que as URLs de callback estejam codificadas em URL e que o esquema seja permitido no seu dispositivo. Evite espaços ou símbolos não escapados em valores de consulta.
Para execução confiável, mantenha o app ativo durante o tempo de execução do teste. Use o agendamento do Shortcuts para acionar execuções em horários específicos.
Defina x-error em cada chamada e ramifique por errorCode. Comece com uma execução curta durationSec=5: se voltar serverNotFound ou connectionTimeout, não vale a pena rodar um teste longo.