JavaScript
import Mobilerun from '@mobilerun/sdk';
const client = new Mobilerun({
apiKey: process.env['MOBILERUN_CLOUD_API_KEY'], // This is the default and can be omitted
});
const response = await client.devices.waitReady('deviceId');
console.log(response.id);import os
from mobilerun_sdk import Mobilerun
client = Mobilerun(
api_key=os.environ.get("MOBILERUN_CLOUD_API_KEY"), # This is the default and can be omitted
)
response = client.devices.wait_ready(
"deviceId",
)
print(response.id)curl --request GET \
--url https://api.mobilerun.ai/v1/devices/{deviceId}/wait \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mobilerun.ai/v1/devices/{deviceId}/wait",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.mobilerun.ai/v1/devices/{deviceId}/wait"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.mobilerun.ai/v1/devices/{deviceId}/wait")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mobilerun.ai/v1/devices/{deviceId}/wait")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"activeTaskId": "<string>",
"assignedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"id": "<string>",
"name": "<string>",
"state": "<string>",
"stateMessage": "<string>",
"streamUrl": "<string>",
"taskCount": 123,
"terminatesAt": "2023-11-07T05:31:56Z",
"type": "<string>",
"updatedAt": "2023-11-07T05:31:56Z",
"$schema": "https://example.com/schemas/DeviceInfo.json",
"billingStrategy": "<string>",
"createdBy": "<string>",
"ownerId": "<string>",
"providerId": "<string>",
"streamToken": "<string>",
"userId": "<string>"
}{
"$schema": "https://example.com/schemas/ErrorModel.json",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}Devices
Wait for device to be ready
Blocks until the device reaches the ready state, then returns the same payload as Get device info. The call returns early with an error if the wait is cancelled or times out.
GET
/
devices
/
{deviceId}
/
wait
JavaScript
import Mobilerun from '@mobilerun/sdk';
const client = new Mobilerun({
apiKey: process.env['MOBILERUN_CLOUD_API_KEY'], // This is the default and can be omitted
});
const response = await client.devices.waitReady('deviceId');
console.log(response.id);import os
from mobilerun_sdk import Mobilerun
client = Mobilerun(
api_key=os.environ.get("MOBILERUN_CLOUD_API_KEY"), # This is the default and can be omitted
)
response = client.devices.wait_ready(
"deviceId",
)
print(response.id)curl --request GET \
--url https://api.mobilerun.ai/v1/devices/{deviceId}/wait \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mobilerun.ai/v1/devices/{deviceId}/wait",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.mobilerun.ai/v1/devices/{deviceId}/wait"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.mobilerun.ai/v1/devices/{deviceId}/wait")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mobilerun.ai/v1/devices/{deviceId}/wait")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"activeTaskId": "<string>",
"assignedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"id": "<string>",
"name": "<string>",
"state": "<string>",
"stateMessage": "<string>",
"streamUrl": "<string>",
"taskCount": 123,
"terminatesAt": "2023-11-07T05:31:56Z",
"type": "<string>",
"updatedAt": "2023-11-07T05:31:56Z",
"$schema": "https://example.com/schemas/DeviceInfo.json",
"billingStrategy": "<string>",
"createdBy": "<string>",
"ownerId": "<string>",
"providerId": "<string>",
"streamToken": "<string>",
"userId": "<string>"
}{
"$schema": "https://example.com/schemas/ErrorModel.json",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}Authorizations
Bearer token via Authorization header
Path Parameters
Response
OK
A URL to the JSON Schema for this object.
Example:
"https://example.com/schemas/DeviceInfo.json"
Deprecated: use ownerId/createdBy.
Was this page helpful?
⌘I