AWS Security ChangesHomeSearch

AWS devicefarm documentation change

Service: devicefarm · 2025-11-19 · Documentation low

File: devicefarm/latest/developerguide/how-to-create-session.md

Summary

Expanded documentation for creating remote access sessions with detailed console steps, AWS CLI instructions, and SDK examples (Python/Java/JS/C#/Ruby). Added device selection guidance, session status monitoring, and concurrency limit explanations.

Security assessment

The change adds a reference to app upload expiration after 30 days (linking to data protection documentation) and mentions concurrency limits/quota management. While these touch on security-adjacent topics like data retention and resource management, there is no evidence of addressing a specific vulnerability or security incident.

Diff

diff --git a/devicefarm/latest/developerguide/how-to-create-session.md b/devicefarm/latest/developerguide/how-to-create-session.md
index dcc503e61..ae0875b2d 100644
--- a//devicefarm/latest/developerguide/how-to-create-session.md
+++ b//devicefarm/latest/developerguide/how-to-create-session.md
@@ -5 +5 @@
-PrerequisitesCreate a session with the Device Farm consoleNext steps
+PrerequisitesCreate a remote sessionNext steps
@@ -13 +13 @@ For information about remote access sessions, see [Sessions](./sessions.html).
-  * Create a test run (console)
+  * Create a remote session
@@ -27 +27,4 @@ For information about remote access sessions, see [Sessions](./sessions.html).
-## Create a session with the Device Farm console
+## Create a remote session
+
+Console
+    
@@ -35 +38,28 @@ For information about remote access sessions, see [Sessions](./sessions.html).
-  4. On the **Remote access** tab, choose **Start a new session**.
+  4. On the **Remote access** tab, choose **Create remote access session**.
+
+  5. 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.
+
+  6. _(Optional)_ Include an app and auxiliary apps 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.html#data-protection-retention)).
+
+  7. In **Session name** , enter a name for the session.
+
+  8. 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.html#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
@@ -37 +67 @@ For information about remote access sessions, see [Sessions](./sessions.html).
-  5. 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. You can search by:
+This will show output such as the following:
@@ -39 +68,0 @@ For information about remote access sessions, see [Sessions](./sessions.html).
-     * Name
@@ -41 +70,13 @@ For information about remote access sessions, see [Sessions](./sessions.html).
-     * Platform
+    {
+        "devices":
+        [
+            {
+                "arn": "arn:aws:devicefarm:us-west-2::device:DE5BD47FF3BD42C3A14BF7A6EFB1BFE7",
+                "name": "Google Pixel 8",
+                "remoteAccessEnabled": true,
+                "availability": "HIGHLY_AVAILABLE"
+                ...
+            },
+            ...
+        ]
+    }
@@ -43 +84 @@ For information about remote access sessions, see [Sessions](./sessions.html).
-     * Form factor
+Then, you can create your remote access session with a device ARN of your choice:
@@ -45 +85,0 @@ For information about remote access sessions, see [Sessions](./sessions.html).
-     * Fleet type
@@ -47 +87,10 @@ For information about remote access sessions, see [Sessions](./sessions.html).
-  6. In **Session name** , enter a name for the session.
+    $ 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"
+          ]
+      }'
@@ -49 +98 @@ For information about remote access sessions, see [Sessions](./sessions.html).
-  7. Choose **Confirm and start session**.
+This will show output such as the following:
@@ -51,0 +101,7 @@ For information about remote access sessions, see [Sessions](./sessions.html).
+    {
+        "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",
+            ...
+    }
@@ -52,0 +109,472 @@ For information about remote access sessions, see [Sessions](./sessions.html).
+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.html#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
+    
+