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
});
await client.devices.actions.swipe('deviceId', {
duration: 10,
endX: 0,
endY: 0,
startX: 0,
startY: 0,
});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
)
client.devices.actions.swipe(
device_id="deviceId",
duration=10,
end_x=0,
end_y=0,
start_x=0,
start_y=0,
)package main
import (
"context"
"github.com/stainless-sdks/droidrun-cloud-go"
"github.com/stainless-sdks/droidrun-cloud-go/option"
)
func main() {
client := mobileruncloud.NewClient(
option.WithAPIKey("My API Key"),
)
err := client.Devices.Actions.Swipe(
context.TODO(),
"deviceId",
mobileruncloud.DeviceActionSwipeParams{
Duration: 10,
EndX: 0,
EndY: 0,
StartX: 0,
StartY: 0,
},
)
if err != nil {
panic(err.Error())
}
}
mobilerun-cloud devices:actions swipe \
--api-key 'My API Key' \
--device-id deviceId \
--duration 10 \
--end-x 0 \
--end-y 0 \
--start-x 0 \
--start-y 0curl --request POST \
--url https://api.mobilerun.ai/devices/{deviceId}/swipe \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"duration": 11,
"endX": 123,
"endY": 123,
"startX": 123,
"startY": 123,
"stealth": false
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mobilerun.ai/devices/{deviceId}/swipe",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'duration' => 11,
'endX' => 123,
'endY' => 123,
'startX' => 123,
'startY' => 123,
'stealth' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://api.mobilerun.ai/devices/{deviceId}/swipe")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"duration\": 11,\n \"endX\": 123,\n \"endY\": 123,\n \"startX\": 123,\n \"startY\": 123,\n \"stealth\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mobilerun.ai/devices/{deviceId}/swipe")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"duration\": 11,\n \"endX\": 123,\n \"endY\": 123,\n \"startX\": 123,\n \"startY\": 123,\n \"stealth\": false\n}"
response = http.request(request)
puts response.read_body{
"$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"
}Navigation
Swipe
Swipes from a start coordinate to an end coordinate over the given duration in milliseconds. An optional stealth flag applies human-like jitter and curved paths on devices that support it.
POST
/
devices
/
{deviceId}
/
swipe
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
});
await client.devices.actions.swipe('deviceId', {
duration: 10,
endX: 0,
endY: 0,
startX: 0,
startY: 0,
});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
)
client.devices.actions.swipe(
device_id="deviceId",
duration=10,
end_x=0,
end_y=0,
start_x=0,
start_y=0,
)package main
import (
"context"
"github.com/stainless-sdks/droidrun-cloud-go"
"github.com/stainless-sdks/droidrun-cloud-go/option"
)
func main() {
client := mobileruncloud.NewClient(
option.WithAPIKey("My API Key"),
)
err := client.Devices.Actions.Swipe(
context.TODO(),
"deviceId",
mobileruncloud.DeviceActionSwipeParams{
Duration: 10,
EndX: 0,
EndY: 0,
StartX: 0,
StartY: 0,
},
)
if err != nil {
panic(err.Error())
}
}
mobilerun-cloud devices:actions swipe \
--api-key 'My API Key' \
--device-id deviceId \
--duration 10 \
--end-x 0 \
--end-y 0 \
--start-x 0 \
--start-y 0curl --request POST \
--url https://api.mobilerun.ai/devices/{deviceId}/swipe \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"duration": 11,
"endX": 123,
"endY": 123,
"startX": 123,
"startY": 123,
"stealth": false
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mobilerun.ai/devices/{deviceId}/swipe",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'duration' => 11,
'endX' => 123,
'endY' => 123,
'startX' => 123,
'startY' => 123,
'stealth' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://api.mobilerun.ai/devices/{deviceId}/swipe")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"duration\": 11,\n \"endX\": 123,\n \"endY\": 123,\n \"startX\": 123,\n \"startY\": 123,\n \"stealth\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mobilerun.ai/devices/{deviceId}/swipe")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"duration\": 11,\n \"endX\": 123,\n \"endY\": 123,\n \"startX\": 123,\n \"startY\": 123,\n \"stealth\": false\n}"
response = http.request(request)
puts response.read_body{
"$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"
}With
stealth: true, the gesture is humanized: start and end points shift randomly (up to ±5 and ±15 pixels), the duration gets ±10% jitter, and supported devices trace a curved path with micro-jitter instead of a straight line. Devices with human-like input support inject the whole gesture with human motor timing instead.
A stealth swipe covering less than ~5 pixels is treated as a long press with slight drift.Authorizations
Bearer token via Authorization header
Headers
Required range:
x >= 0Path Parameters
Body
application/json
Response
No Content
Was this page helpful?
⌘I