

# Remote access in AWS Device Farm
<a name="remote-access"></a>

 Remote access, or manual testing, allows you to swipe, gesture, and interact with a device through your web browser in real time to test functionality and reproduce customer issues. You interact with a specific device by creating a remote access session with that device. The following key features are supported on Remote Access:
+ **App(s) upload:** Upload app files (.apk, .ipa) or test on web browsers.
+ **Appium Endpoint:** Connect to an Appium Endpoint right from your remote access session.
+ **Orientation change:** Change between Portrait and Landscape mode.
+ **Network shaping:** Select a pre-configured network profile or create your own.
+ **Location mocking:** Mock a location by providing the latitude and longitude.
+ **Screenshot:** Capture the screenshot of any screen.
+ **Video recording:** Capture the video of your entire test run.
+ **Logs:** Stream live log for Appium and get device, network, and activity logs at the end of your session.

A session in Device Farm is a real-time interaction with an actual, physical device hosted in a web browser. A session displays the single device you select when you start the session. A user can start more than one session at a time with the total number of simultaneous devices limited by the number of device slots you have. You can purchase device slots based on the device family (Android or iOS devices). For more information, see [Device Farm Pricing](https://aws.amazon.com/device-farm/pricing/). 

Device Farm currently offers a subset of devices for remote access testing. New devices are added to the device pool all the time.

Device Farm captures video of each remote access session and generates logs of activity during the session. These results include any information you provide during a session.

**Note**  
For security reasons, we recommend that you avoid providing or entering sensitive information, such as account numbers, personal login information, and other details during a remote access session. If possible, use alternatives developed specifically for testing, such as test accounts.

**Topics**
+ [

# Creating a remote access session in AWS Device Farm
](how-to-create-session.md)
+ [

# Using a remote access session in AWS Device Farm
](how-to-use-session.md)
+ [

# Retrieving the results of a remote access session in AWS Device Farm
](how-to-access-session-results.md)

# Creating a remote access session in AWS Device Farm
<a name="how-to-create-session"></a>

For information about remote access sessions, see [Sessions](sessions.md).
+ [Prerequisites](#how-to-create-session-prerequisites)
+ [Create a remote session](#how-to-create-remote-session)
+ [Next steps](#how-to-create-session-next-steps)

## Prerequisites
<a name="how-to-create-session-prerequisites"></a>
+ Create a project in Device Farm. Follow the instructions in [Creating a project in AWS Device Farm](how-to-create-project.md), and then return to this page.

## Create a remote session
<a name="how-to-create-remote-session"></a>

------
#### [ Console ]

1. Sign in to the Device Farm console at [https://console.aws.amazon.com/devicefarm](https://console.aws.amazon.com/devicefarm).

1. On the Device Farm navigation panel, choose **Mobile Device Testing**, then choose **Projects**.

1. If you already have a project, choose it from the list. Otherwise, create a project by following the instructions in [Creating a project in AWS Device Farm](how-to-create-project.md).

1. On the **Remote access** tab, choose **Create remote access session**.

1. Choose a device for your session. You can choose from the list of available devices or search for a device using the search bar at the top of the list.

1. In **Session name**, enter a name for the session.

1. *(Optional)* Under **Select applications**, include your own app or choose the Device Farm Sample App as part of the session. These can be newly uploaded apps, or apps previously uploaded in this project from the past 30 days (after 30 days, app uploads [will expire](data-protection.md#data-protection-retention)).

1. *(Optional)* Under **Advanced Configuration**, you can add a http/s **Device Proxy** which will get set for the duration of your session.

1. Choose **Confirm and start session**.

------
#### [ AWS CLI ]

*Note: these instructions focus only on creating a remote access session. For instructions on how to upload an app for use during your session, please see [automating app uploads.](api-ref.md#upload-example)*

First, verify that your AWS CLI version is up-to-date by [downloading and installing the latest version](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html).

**Important**  
Certain commands mentioned in this document aren't available in older versions of the AWS CLI.

Then, you can determine which device you'd like to test on:

```
$ aws devicefarm list-devices
```

This will show output such as the following:

```
{
    "devices":
    [
        {
            "arn": "arn:aws:devicefarm:us-west-2::device:DE5BD47FF3BD42C3A14BF7A6EFB1BFE7",
            "name": "Google Pixel 8",
            "remoteAccessEnabled": true,
            "availability": "HIGHLY_AVAILABLE"
            ...
        },
        ...
    ]
}
```

Then, you can create your remote access session with a device ARN of your choice:

```
$ aws devicefarm create-remote-access-session \
  --project-arn arn:aws:devicefarm:us-west-2:111122223333:project:12345678-1111-2222-333-456789abcdef \
  --device-arn arn:aws:devicefarm:us-west-2::device:DE5BD47FF3BD42C3A14BF7A6EFB1BFE7 \
  --app-arn arn:aws:devicefarm:us-west-2:111122223333:upload:12345678-1111-2222-333-456789abcdef/12345678-1111-2222-333-456789abcdef \
  --configuration '{
      "auxiliaryApps": [
          "arn:aws:devicefarm:us-west-2:111122223333:upload:12345678-1111-2222-333-456789abcdef/12345678-1111-2222-333-456789abcde0",
          "arn:aws:devicefarm:us-west-2:111122223333:upload:12345678-1111-2222-333-456789abcdef/12345678-1111-2222-333-456789abcde1"
      ]
  }'
```

This will show output such as the following:

```
{
    "remoteAccessSession": {
        "arn": "arn:aws:devicefarm:us-west-2:111122223333:session:abcdef123456-1234-5678-abcd-abcdef123456/abcdef123456-1234-5678-abcd-abcdef123456/00000",
        "name": "Google Pixel 8",
        "status": "PENDING",
        ...
}
```

Now, optionally, we can poll and wait for the session to be ready:

```
$ POLL_INTERVAL=3
TIMEOUT=600
DEADLINE=$(( $(date +%s) + TIMEOUT ))

while [[ "$(date +%s)" -lt "$DEADLINE" ]]; do

  STATUS=$(aws devicefarm get-remote-access-session \
    --arn "$DEVICE_FARM_SESSION_ARN" \
    --query 'remoteAccessSession.status' \
    --output text)

  case "$STATUS" in
    RUNNING)
      echo "Session is ready with status: $STATUS"
      break
      ;;
    STOPPING|COMPLETED)
      echo "Session ended early with status: $STATUS"
      exit 1
      ;;
  esac

done
```

------
#### [ Python ]

*Note: these instructions focus only on creating a remote access session. For instructions on how to upload an app for use during your session, please see [automating app uploads.](api-ref.md#upload-example)*

This example first finds any available Google Pixel device on Device Farm, then creates a remote access session with it and waits until the session is running.

```
import random
import time
import boto3

client = boto3.client("devicefarm", region_name="us-west-2")

# 1) Gather all matching devices via paginated ListDevices with filters
filters = [
    {"attribute": "MODEL",        "operator": "CONTAINS", "values": ["Pixel"]},
    {"attribute": "AVAILABILITY", "operator": "EQUALS",   "values": ["AVAILABLE"]},
]

matching_arns = []
next_token = None
while True:
    args = {"filters": filters}
    if next_token:
        args["nextToken"] = next_token
    page = client.list_devices(**args)
    for d in page.get("devices", []):
        matching_arns.append(d["arn"])
    next_token = page.get("nextToken")
    if not next_token:
        break

if not matching_arns:
    raise RuntimeError("No available Google Pixel device found.")

# Randomly select one device from the full matching set
device_arn = random.choice(matching_arns)
print("Selected device ARN:", device_arn)

# 2) Create remote access session and wait until RUNNING
resp = client.create_remote_access_session(
    projectArn="arn:aws:devicefarm:us-west-2:111122223333:project:12345678-1111-2222-333-456789abcdef",
    deviceArn=device_arn,
    appArn="arn:aws:devicefarm:us-west-2:111122223333:upload:12345678-1111-2222-333-456789abcdef/12345678-1111-2222-333-456789abcdef",  # optional
    configuration={
        "auxiliaryApps": [  # optional
            "arn:aws:devicefarm:us-west-2:111122223333:upload:12345678-1111-2222-333-456789abcdef/12345678-1111-2222-333-456789abcde0",
            "arn:aws:devicefarm:us-west-2:111122223333:upload:12345678-1111-2222-333-456789abcdef/12345678-1111-2222-333-456789abcde1",
        ]
    },
)

session_arn = resp["remoteAccessSession"]["arn"]
print(f"Created Remote Access Session: {session_arn}")

poll_interval = 3
timeout = 600
deadline = time.time() + timeout
terminal_states = ["STOPPING", "COMPLETED"]

while True:
    out = client.get_remote_access_session(arn=session_arn)
    status = out["remoteAccessSession"]["status"]
    print(f"Current status: {status}")

    if status == "RUNNING":
        print(f"Session is ready with status: {status}")
        break
    if status in terminal_states:
        raise RuntimeError(f"Session ended early with status: {status}")
    if time.time() >= deadline:
        raise RuntimeError("Timed out waiting for session to be ready.")
    time.sleep(poll_interval)
```

------
#### [ Java ]

*Note: these instructions focus only on creating a remote access session. For instructions on how to upload an app for use during your session, please see [automating app uploads.](api-ref.md#upload-example)*

*Note: this example uses the AWS SDK for Java v2, and is compatible with JDK versions 11 and higher.*

This example first finds any available Google Pixel device on Device Farm, then creates a remote access session with it and waits until the session is running.

```
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.ThreadLocalRandom;
import software.amazon.awssdk.regions.Region;
import software.amazon.awssdk.services.devicefarm.DeviceFarmClient;
import software.amazon.awssdk.services.devicefarm.model.CreateRemoteAccessSessionConfiguration;
import software.amazon.awssdk.services.devicefarm.model.CreateRemoteAccessSessionRequest;
import software.amazon.awssdk.services.devicefarm.model.CreateRemoteAccessSessionResponse;
import software.amazon.awssdk.services.devicefarm.model.Device;
import software.amazon.awssdk.services.devicefarm.model.DeviceFilter;
import software.amazon.awssdk.services.devicefarm.model.DeviceFilterAttribute;
import software.amazon.awssdk.services.devicefarm.model.GetRemoteAccessSessionRequest;
import software.amazon.awssdk.services.devicefarm.model.GetRemoteAccessSessionResponse;
import software.amazon.awssdk.services.devicefarm.model.ListDevicesRequest;
import software.amazon.awssdk.services.devicefarm.model.ListDevicesResponse;
import software.amazon.awssdk.services.devicefarm.model.RuleOperator;

public class CreateRemoteAccessSession {
  public static void main(String[] args) throws Exception {
    DeviceFarmClient client = DeviceFarmClient.builder()
        .region(Region.US_WEST_2)
        .build();

    String projectArn = "arn:aws:devicefarm:us-west-2:111122223333:project:12345678-1111-2222-333-456789abcdef";
    String appArn     = "arn:aws:devicefarm:us-west-2:111122223333:upload:12345678-1111-2222-333-456789abcdef/12345678-1111-2222-333-456789abcdef";
    String aux1       = "arn:aws:devicefarm:us-west-2:111122223333:upload:12345678-1111-2222-333-456789abcdef/12345678-1111-2222-333-456789abcde0";
    String aux2       = "arn:aws:devicefarm:us-west-2:111122223333:upload:12345678-1111-2222-333-456789abcdef/12345678-1111-2222-333-456789abcde1";

    // 1) Gather all matching devices via paginated ListDevices with filters
    List<DeviceFilter> filters = Arrays.asList(
        DeviceFilter.builder()
            .attribute(DeviceFilterAttribute.MODEL)
            .operator(RuleOperator.CONTAINS)
            .values("Pixel")
            .build(),
        DeviceFilter.builder()
            .attribute(DeviceFilterAttribute.AVAILABILITY)
            .operator(RuleOperator.EQUALS)
            .values("AVAILABLE")
            .build()
    );

    List<String> matchingDeviceArns = new ArrayList<>();
    String next = null;
    do {
      ListDevicesResponse page = client.listDevices(
          ListDevicesRequest.builder().filters(filters).nextToken(next).build());
      for (Device d : page.devices()) {
        matchingDeviceArns.add(d.arn());
      }
      next = page.nextToken();
    } while (next != null);

    if (matchingDeviceArns.isEmpty()) {
      throw new RuntimeException("No available Google Pixel device found.");
    }

    // Randomly select one device from the full matching set
    String deviceArn = matchingDeviceArns.get(
        ThreadLocalRandom.current().nextInt(matchingDeviceArns.size()));
    System.out.println("Selected device ARN: " + deviceArn);

    // 2) Create Remote Access session and wait until it is RUNNING
    CreateRemoteAccessSessionConfiguration cfg = CreateRemoteAccessSessionConfiguration.builder()
        .auxiliaryApps(Arrays.asList(aux1, aux2))
        .build();

    CreateRemoteAccessSessionResponse res = client.createRemoteAccessSession(
        CreateRemoteAccessSessionRequest.builder()
            .projectArn(projectArn)
            .deviceArn(deviceArn)
            .appArn(appArn)       // optional
            .configuration(cfg)   // optional
            .build());

    String sessionArn = res.remoteAccessSession().arn();
    System.out.println("Created Remote Access Session: " + sessionArn);

    int pollIntervalMs = 3000;
    long timeoutMs = 600_000L;
    long deadline = System.currentTimeMillis() + timeoutMs;

    while (true) {
      GetRemoteAccessSessionResponse get = client.getRemoteAccessSession(
          GetRemoteAccessSessionRequest.builder().arn(sessionArn).build());
      String status = get.remoteAccessSession().statusAsString();
      System.out.println("Current status: " + status);

      if ("RUNNING".equals(status)) {
        System.out.println("Session is ready with status: " + status);
        break;
      }
      if ("STOPPING".equals(status) || "COMPLETED".equals(status)) {
        throw new RuntimeException("Session ended early with status: " + status);
      }
      if (System.currentTimeMillis() >= deadline) {
        throw new RuntimeException("Timed out waiting for session to be ready.");
      }
      Thread.sleep(pollIntervalMs);
    }
  }
}
```

------
#### [ JavaScript ]

*Note: these instructions focus only on creating a remote access session. For instructions on how to upload an app for use during your session, please see [automating app uploads.](api-ref.md#upload-example)*

*Note: this example uses AWS SDK for JavaScript v3.*

This example first finds any available Google Pixel device on Device Farm, then creates a remote access session with it and waits until the session is running.

```
import {
  DeviceFarmClient,
  ListDevicesCommand,
  CreateRemoteAccessSessionCommand,
  GetRemoteAccessSessionCommand,
} from "@aws-sdk/client-device-farm";

const client = new DeviceFarmClient({ region: "us-west-2" });

// 1) Gather all matching devices via paginated ListDevices with filters
const filters = [
  { attribute: "MODEL",        operator: "CONTAINS", values: ["Pixel"] },
  { attribute: "AVAILABILITY", operator: "EQUALS",   values: ["AVAILABLE"] },
];

let nextToken;
const matching = [];

while (true) {
  const page = await client.send(new ListDevicesCommand({ filters, nextToken }));
  for (const d of page.devices ?? []) {
    matching.push(d.arn);
  }
  nextToken = page.nextToken;
  if (!nextToken) break;
}

if (matching.length === 0) {
  throw new Error("No available Google Pixel device found.");
}

// Randomly select one device from the full matching set
const deviceArn = matching[Math.floor(Math.random() * matching.length)];
console.log("Selected device ARN:", deviceArn);

// 2) Create remote access session and wait until RUNNING
const out = await client.send(new CreateRemoteAccessSessionCommand({
  projectArn: "arn:aws:devicefarm:us-west-2:111122223333:project:12345678-1111-2222-333-456789abcdef",
  deviceArn,
  appArn: "arn:aws:devicefarm:us-west-2:111122223333:upload:12345678-1111-2222-333-456789abcdef/12345678-1111-2222-333-456789abcdef", // optional
  configuration: {
    auxiliaryApps: [ // optional
      "arn:aws:devicefarm:us-west-2:111122223333:upload:12345678-1111-2222-333-456789abcdef/12345678-1111-2222-333-456789abcde0",
      "arn:aws:devicefarm:us-west-2:111122223333:upload:12345678-1111-2222-333-456789abcdef/12345678-1111-2222-333-456789abcde1",
    ],
  },
}));

const sessionArn = out.remoteAccessSession?.arn;
console.log("Created Remote Access Session:", sessionArn);

const pollIntervalMs = 3000;
const timeoutMs = 600000;
const deadline = Date.now() + timeoutMs;

while (true) {
  const get = await client.send(new GetRemoteAccessSessionCommand({ arn: sessionArn }));
  const status = get.remoteAccessSession?.status;
  console.log("Current status:", status);

  if (status === "RUNNING") {
    console.log("Session is ready with status:", status);
    break;
  }
  if (status === "STOPPING" || status === "COMPLETED") {
    throw new Error(`Session ended early with status: ${status}`);
  }
  if (Date.now() >= deadline) {
    throw new Error("Timed out waiting for session to be ready.");
  }
  await new Promise((r) => setTimeout(r, pollIntervalMs));
}
```

------
#### [ C\$1 ]

*Note: these instructions focus only on creating a remote access session. For instructions on how to upload an app for use during your session, please see [automating app uploads.](api-ref.md#upload-example)*

This example first finds any available Google Pixel device on Device Farm, then creates a remote access session with it and waits until the session is running.

```
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Amazon;
using Amazon.DeviceFarm;
using Amazon.DeviceFarm.Model;

class Program
{
    static async Task Main()
    {
        var client = new AmazonDeviceFarmClient(RegionEndpoint.USWest2);

        // 1) Gather all matching devices via paginated ListDevices with filters
        var filters = new List<DeviceFilter>
        {
            new DeviceFilter { Attribute = DeviceAttribute.MODEL,        Operator = RuleOperator.CONTAINS, Values = new List<string>{ "Pixel" } },
            new DeviceFilter { Attribute = DeviceAttribute.AVAILABILITY, Operator = RuleOperator.EQUALS,   Values = new List<string>{ "AVAILABLE" } },
        };

        var matchingArns = new List<string>();
        string nextToken = null;

        do
        {
            var list = await client.ListDevicesAsync(new ListDevicesRequest
            {
                Filters = filters,
                NextToken = nextToken
            });

            foreach (var d in list.Devices)
                matchingArns.Add(d.Arn);

            nextToken = list.NextToken;
        }
        while (nextToken != null);

        if (matchingArns.Count == 0)
            throw new Exception("No available Google Pixel device found.");

        // Randomly select one device from the full matching set
        var rnd = new Random();
        var deviceArn = matchingArns[rnd.Next(matchingArns.Count)];
        Console.WriteLine($"Selected device ARN: {deviceArn}");

        // 2) Create remote access session and wait until RUNNING
        var request = new CreateRemoteAccessSessionRequest
        {
            ProjectArn = "arn:aws:devicefarm:us-west-2:111122223333:project:12345678-1111-2222-333-456789abcdef",
            DeviceArn  = deviceArn,
            AppArn     = "arn:aws:devicefarm:us-west-2:111122223333:upload:12345678-1111-2222-333-456789abcdef/12345678-1111-2222-333-456789abcdef", // optional
            Configuration = new CreateRemoteAccessSessionConfiguration
            {
                AuxiliaryApps = new List<string>
                {
                    "arn:aws:devicefarm:us-west-2:111122223333:upload:12345678-1111-2222-333-456789abcdef/12345678-1111-2222-333-456789abcde0",
                    "arn:aws:devicefarm:us-west-2:111122223333:upload:12345678-1111-2222-333-456789abcdef/12345678-1111-2222-333-456789abcde1"
                }
            }
        };

        request.Configuration.AuxiliaryApps.RemoveAll(string.IsNullOrWhiteSpace);

        var response = await client.CreateRemoteAccessSessionAsync(request);
        var sessionArn = response.RemoteAccessSession.Arn;
        Console.WriteLine($"Created Remote Access Session: {sessionArn}");

        var pollIntervalMs = 3000;
        var timeoutMs = 600000;
        var deadline = DateTime.UtcNow.AddMilliseconds(timeoutMs);

        while (true)
        {
            var get = await client.GetRemoteAccessSessionAsync(new GetRemoteAccessSessionRequest { Arn = sessionArn });
            var status = get.RemoteAccessSession.Status.Value;
            Console.WriteLine($"Current status: {status}");

            if (status == "RUNNING")
            {
                Console.WriteLine($"Session is ready with status: {status}");
                break;
            }
            if (status == "STOPPING" || status == "COMPLETED")
            {
                throw new Exception($"Session ended early with status: {status}");
            }
            if (DateTime.UtcNow >= deadline)
            {
                throw new TimeoutException("Timed out waiting for session to be ready.");
            }

            await Task.Delay(pollIntervalMs);
        }
    }
}
```

------
#### [ Ruby ]

*Note: these instructions focus only on creating a remote access session. For instructions on how to upload an app for use during your session, please see [automating app uploads.](api-ref.md#upload-example)*

This example first finds any available Google Pixel device on Device Farm, then creates a remote access session with it and waits until the session is running.

```
require 'aws-sdk-devicefarm'

client = Aws::DeviceFarm::Client.new(region: 'us-west-2')

# 1) Gather all matching devices via paginated ListDevices with filters
filters = [
  { attribute: 'MODEL',        operator: 'CONTAINS', values: ['Pixel'] },
  { attribute: 'AVAILABILITY', operator: 'EQUALS',   values: ['AVAILABLE'] },
]

matching_arns = []
next_token = nil
loop do
  resp = client.list_devices(filters: filters, next_token: next_token)
  resp.devices&.each { |d| matching_arns << d.arn }
  next_token = resp.next_token
  break unless next_token
end

abort "No available Google Pixel device found." if matching_arns.empty?

# Randomly select one device from the full matching set
device_arn = matching_arns.sample
puts "Selected device ARN: #{device_arn}"

# 2) Create remote access session and wait until RUNNING
resp = client.create_remote_access_session(
  project_arn: "arn:aws:devicefarm:us-west-2:111122223333:project:12345678-1111-2222-333-456789abcdef",
  device_arn:  device_arn,
  app_arn:     "arn:aws:devicefarm:us-west-2:111122223333:upload:12345678-1111-2222-333-456789abcdef/12345678-1111-2222-333-456789abcdef", # optional
  configuration: {
    auxiliary_apps: [ # optional
      "arn:aws:devicefarm:us-west-2:111122223333:upload:12345678-1111-2222-333-456789abcdef/12345678-1111-2222-333-456789abcde0",
      "arn:aws:devicefarm:us-west-2:111122223333:upload:12345678-1111-2222-333-456789abcdef/12345678-1111-2222-333-456789abcde1"
    ].compact
  }
)

session_arn = resp.remote_access_session.arn
puts "Created Remote Access Session: #{session_arn}"

poll_interval = 3
timeout = 600
deadline = Time.now + timeout
terminal = %w[STOPPING COMPLETED]

loop do
  get = client.get_remote_access_session(arn: session_arn)
  status = get.remote_access_session.status
  puts "Current status: #{status}"

  if status == 'RUNNING'
    puts "Session is ready with status: #{status}"
    break
  end

  abort "Session ended early with status: #{status}" if terminal.include?(status)
  abort "Timed out waiting for session to be ready." if Time.now >= deadline
  sleep poll_interval
end
```

------

## Next steps
<a name="how-to-create-session-next-steps"></a>

Device Farm starts the session as soon as the requested device and infrastructure are available, typically within a few minutes. The **Device Requested** dialog box appears until the session starts. To cancel the session request, choose **Cancel request**. 

If the selected device is unavailable or busy, the session status shows as **Pending Device**, indicating that you may need to wait for some time before the device is available for testing.

If your account has reached its concurrency limit for public metered or unmetered devices, the session status shows as **Pending concurrency**. For unmetered device slots, you can increase concurrency by [purchasing more device slots](how-to-purchase-device-slots.md). For metered pay-as-you-go devices, please contact AWS via a support ticket to request [a service quota increase](limits.md).

When the session setup begins, it first shows a status of **In-Progress**, then a status of **Connecting** while your local web browser attempts to open a remote connection to the device.

After a session starts, if you should close the browser or browser tab without stopping the session or if the connection between the browser and the internet is lost, the session remains active for five minutes. After that, Device Farm ends the session. Your account is charged for the idle time. 

After the session starts, you can interact with the device in the web browser, or test the device using [Appium](appium-endpoint.md).

# Using a remote access session in AWS Device Farm
<a name="how-to-use-session"></a>

For information about performing interactive testing of Android and iOS apps through remote access sessions, see [Sessions](sessions.md).
+ [Prerequisites](#how-to-use-session-prerequisites)
+ [Use a session in the Device Farm console](#how-to-use-session-console)
+ [Next steps](#how-to-use-session-next-steps)
+ [Tips and tricks](#how-to-use-session-tips)

## Prerequisites
<a name="how-to-use-session-prerequisites"></a>
+ Create a session. Follow the instructions in [Creating a session](how-to-create-session.md), and then return to this page.

## Use a session in the Device Farm console
<a name="how-to-use-session-console"></a>

As soon as the device that you requested for a remote access session becomes available, the console displays the device screen. The session has a maximum length of 150 minutes. The time remaining in the session appears in the **Time left** field in the top-right corner above the device.

## Actions
<a name="how-to-use-actions"></a>

All actions you can take with the device and your session reside in the menu on the left-hand side of the device. The available actions are explained in detail below. 

![\[\]](http://docs.aws.amazon.com/devicefarm/latest/developerguide/images/actions_menu.png)


## Navigating the device
<a name="how-to-navigate-the-device"></a>

You can interact with the device displayed in the console as you would with a real physical device, by using your mouse or a pointer device like touchpad for touch and your local keyboard. The swipe action works based on starting and ending coordinates of your click. This means a three or more point swipe does not work. On an Android device, you have the **Home**, **Back**, and **Switch apps** buttons. On an iOS device, you have the **Home** button. These buttons on both function just as real device controls. 

![\[\]](http://docs.aws.amazon.com/devicefarm/latest/developerguide/images/navigating_device.png)


## Taking a screenshot
<a name="how-to-use-screenshot"></a>

A common pattern while doing manual testing is to take a device screenshot. You can do this by using the **Screenshot** button in the left menu bar. On clicking this button, a screenshot of the current device screen is downloaded in your browser's download folder as a .jpeg extension. The button greys out when the screenshot is being processed and downloaded.

## Switching between portrait and landscape mode
<a name="how-to-use-session-switch-between-portrait-landscape-mode"></a>

You can switch between portrait (vertical) and landscape (horizontal) view on the device using the **Rotate** option. The orientation of the device display only changes if the active view on the device supports it. For example, the home page on a smaller iPhone does not support orientation change. Thus, you will not see the orientation change when using **Rotate**. 

![\[\]](http://docs.aws.amazon.com/devicefarm/latest/developerguide/images/change_orientation_remote_access.gif)


## Changing network
<a name="how-to-use-network-shaping"></a>

You can change the network behavior by changing parameters such as upload/download speeds, bandwidth, packet loss for the device under test. Click the **Network** button in the left side menu. This opens up a right hand side overlay where you can choose from a list of curated network settings or create your own network profile.

![\[\]](http://docs.aws.amazon.com/devicefarm/latest/developerguide/images/network_settings.gif)


## Mocking location
<a name="how-to-use-location-mocking"></a>

You can mock a location on the device by providing the latitude and longitude of your desired location. This does not physically get a device in that region but when an app queries the OS for its location, the device returns the location you entered. If your app uses multiple data points such as Wi-Fi, cellular signal, and other methods rather than just querying the OS for location then this feature will most likely not work for your app. Click the **Set location** button in the left-side menu. This opens up a right hand side overlay where you can input the latitude and longitude of your desired location. 

![\[\]](http://docs.aws.amazon.com/devicefarm/latest/developerguide/images/mock_location.gif)


## Installing an application
<a name="how-to-use-session-install-app"></a>

You can install apps in a remote access session in two ways: 1) During session launch, you can upload an app or specify a recently used app. 2) After the remote access session has started, you can manually upload/install the app using the **Install app** option in the left side menu, and then choose the .apk file (Android) or the .ipa file (iOS) that you want to install. Applications that you run in a remote access session don't require any test instrumentation or provisioning.

**Note**  
When you upload an app, the service first uploads the app to a secure Amazon S3 bucket and then installs it which takes a few seconds depending on the size of the app. A confirmation message will appear to let you know if the app was successfully installed or not.

![\[\]](http://docs.aws.amazon.com/devicefarm/latest/developerguide/images/install_app_remote_access.gif)


## Installing a recently uploaded application
<a name="how-to-use-recent-apps"></a>

To install an application recently uploaded, select **Recent apps** in the left side menu, and then choose the .apk file (Android) or the .ipa file (iOS) that you want to install from the dropdown selection.

**Note**  
When you select a recent app, the service first downloads the previously uploaded app from a secure service managed S3 bucket to the host machine running your session and then installs it which takes a few seconds depending on the size of the app. A confirmation message will appear to let you know if the app was successfully installed or not.

![\[\]](http://docs.aws.amazon.com/devicefarm/latest/developerguide/images/install_recent_apps_remote_access.gif)


## View device details
<a name="how-to-get-device-info"></a>

You can view device details such as the ARN, Model ID, CPU, Resolution, Memory, and Heap Size of the device being used in your session by clicking on the **Device details** button. This action displays the device details in a new tab. For a public device, the details do not include UDID as that can change across every session. For private devices, the device details page displays the Instance and Device ARN along with UDID and Labels assigned to the private device instance. 

![\[\]](http://docs.aws.amazon.com/devicefarm/latest/developerguide/images/public_device_details.gif)


## Appium Session
<a name="how-to-get-appium-session-info"></a>

You can get the Appium Session details attached to your remote access session by clicking on the **Appium Session** button.

![\[\]](http://docs.aws.amazon.com/devicefarm/latest/developerguide/images/appium_session_remote_access.gif)


## Session ARN
<a name="how-to-get-session-arn"></a>

You can copy the session ARN of your remote access session using the **Session ARN** button.

## Appium URL
<a name="how-to-get-appium-url"></a>

You can copy the Appium URL for your remote access session using the **Appium URL** button.

## Minimize left side menu
<a name="how-to-minimize-actions-menu"></a>

You can get a minimized icons-only version of all the actions in the left-hand side menu of remote access session using the **Minimize** button.

![\[\]](http://docs.aws.amazon.com/devicefarm/latest/developerguide/images/minimize_actions_menu.gif)


## Next steps
<a name="how-to-use-session-next-steps"></a>

Device Farm continues the session until you stop it manually or the 150-minute time limit is reached. To end the session, choose **Stop Session**. After the session stops, you can access the video that was captured and the logs that were generated. For more information, see [Retrieving session results](how-to-access-session-results.md).

## Tips and tricks
<a name="how-to-use-session-tips"></a>

You might experience performance issues with the remote access session if you are located in a region geographically distant from us-west-2. This is due, in part, to latency in some Regions. If you experience performance issues, give the remote access session a chance to catch up before you interact with the app again.

# Retrieving the results of a remote access session in AWS Device Farm
<a name="how-to-access-session-results"></a>

For information about sessions, see [Sessions](sessions.md).
+ [Prerequisites](#how-to-access-session-results-prerequisites)
+ [Viewing session details](#how-to-view-session-details)
+ [Downloading session video or logs](#how-to-access-session-files)

## Prerequisites
<a name="how-to-access-session-results-prerequisites"></a>
+ Complete a session. Follow the instructions in [Using a remote access session in AWS Device FarmUsing a session](how-to-use-session.md), and then return to this page.

## Viewing session details
<a name="how-to-view-session-details"></a>

When a remote access session ends, the Device Farm console displays a table that contains details about activity during the session. For more information, see [Analyzing Log Information](how-to-use-reports.md#how-to-use-reports-console-log).

To return to the details of a session at a later time:

1. On the Device Farm navigation panel, choose **Mobile Device Testing**, then choose **Projects**.

1. Choose the project containing the session.

1. Choose **Remote access**, and then choose the session you want to review from the list.

## Downloading session video or logs
<a name="how-to-access-session-files"></a>

When a remote access session ends, the Device Farm console provides access to a video capture of the session and activity logs. In the session results, choose the **Files** tab for a list of links to the session video and logs. You can view these files in the browser or save them locally.