From 79fe9bc831dd7b3fb81191079ac1b5cc566c159a Mon Sep 17 00:00:00 2001
From: Isha vyas <72408461+Ishavyas9@users.noreply.github.com>
Date: Thu, 30 Jan 2025 13:46:06 +0530
Subject: [PATCH 1/3] Merge pull request #1291 from amanchopra1905/stage
added a note in the start
---
docs/adb-commands-support.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/adb-commands-support.md b/docs/adb-commands-support.md
index 677b74ecc..41c8df828 100644
--- a/docs/adb-commands-support.md
+++ b/docs/adb-commands-support.md
@@ -56,7 +56,7 @@ driver.execute_script("lambda-adb", params)
## Supported Commands
----
+> **NOTE :** All these commands are supported on both Real and Virtual Devices except for the [**adb shell dumpsys**](/support/docs/adb-commands-support/#adb-shell-command) command, which is not supported for Virtual Device.
### Swipe
**adb shell input swipe**
From 32e67b3f749e097d1694f315cc4f1cda1a27117b Mon Sep 17 00:00:00 2001
From: ShubhamSuri <70204532+surishubham@users.noreply.github.com>
Date: Fri, 31 Jan 2025 19:42:39 +0530
Subject: [PATCH 2/3] Merge pull request #1300 from amanchopra1905/stage
adb commands
---
docs/adb-commands-support.md | 36 ++++++++++++++++++++++++----------
src/component/realDevice.js | 9 +++++++++
src/component/virtualDevice.js | 9 +++++++++
3 files changed, 44 insertions(+), 10 deletions(-)
create mode 100644 src/component/realDevice.js
create mode 100644 src/component/virtualDevice.js
diff --git a/docs/adb-commands-support.md b/docs/adb-commands-support.md
index 41c8df828..213a03e2c 100644
--- a/docs/adb-commands-support.md
+++ b/docs/adb-commands-support.md
@@ -20,6 +20,8 @@ slug: adb-commands-support/
import CodeBlock from '@theme/CodeBlock';
import {YOUR_LAMBDATEST_USERNAME, YOUR_LAMBDATEST_ACCESS_KEY} from "@site/src/component/keys";
+import RealDeviceTag from '../src/component/realDevice';
+import VirtualDeviceTag from '../src/component/virtualDevice';
-
-
Android Debug Bridge (adb) is a versatile command-line tool that lets users communicate with a device. The adb command facilitates a variety of device actions, such as installing and debugging apps.
LambdaTest provides support for limited commands which can be executed in your app automation test scripts via javascript executors. The following command with the below mentioned parameters need to be used to execute adb command with LambdaTest real device cloud.
@@ -59,7 +59,7 @@ driver.execute_script("lambda-adb", params)
> **NOTE :** All these commands are supported on both Real and Virtual Devices except for the [**adb shell dumpsys**](/support/docs/adb-commands-support/#adb-shell-command) command, which is not supported for Virtual Device.
### Swipe
-**adb shell input swipe**
+**adb shell input swipe**
The command is used to generate a swipe gesture by defining the coordinates of starting and ending point of the swipe. The following is a Python sample of using the adb swipe command with LambdaTest executor.
@@ -70,7 +70,7 @@ result = driver.execute_script("lambda-adb",params)
### Clipboard
-**adb shell input sendKeys**
+**adb shell input sendKeys**
The command is used to sends text as if typed at the keyboard in the real devices. The following is a Python sample of using the adb sendKeys command with LambdaTest executor.
@@ -81,7 +81,7 @@ result = driver.execute_script("lambda-adb",params)
### Home Button
-- **Navigate to the home screen**
+- **Navigate to the home screen**
The command is used to navigate to the home screen of the device while running an app automation test script. The following is a Python sample of using the adb command to navigate to the home screen with LambdaTest executor.
@@ -92,7 +92,7 @@ result = driver.execute_script("lambda-adb",params)
### Enable/Disable auto rotate
-- **enableAutoRotate**
+- **enableAutoRotate**
The command is used to auto rotate the screen of the device while running an app automation test script. The following is a Python sample using the adb command to allow auto rotation with LambdaTest executor.
@@ -102,7 +102,7 @@ result = driver.execute_script("lambda-adb",params)
```
### ADB Shell Command
-- **adb shell dumpsys**
+- **adb shell dumpsys**
This command is used to obtain detailed information about installed packages on device. When you run this command, it provides a list of information for each package installed on the device. The output includes various details about each package.The following is a Python sample using the adb command:
@@ -110,9 +110,10 @@ This command is used to obtain detailed information about installed packages on
params = {"command": "shell", "text": "dumpsys package "}
result = driver.execute_script("lambda-adb",params)
```
+
### Enable/Disable Notification
-- **enableNotification**
+- **enableNotification**
These commands enable or disable your app notifications on the device based on the value provided for `enableNotification`. **True** is used to enable notifications, while **False** is used to disable them.The following is a Python sample using the adb command with LambdaTest executor:
@@ -128,7 +129,7 @@ result = driver.execute_script("lambda-adb",params)
### Enable/Disable Battery Optimization
-- **disableBatteryOptimization**
+- **disableBatteryOptimization**
This command is used to enable or disable battery optimization for your app on the device. The following is a Python sample using the adb command to disable battery optimization with LambdaTest executor:
@@ -139,7 +140,7 @@ result = driver.execute_script("lambda-adb",params)
### Fixed-to-User Rotation
-- **fixedToUserRotation**
+- **fixedToUserRotation**
This command serves to lock the screen rotation in alignment with the app's default behavior and user-defined settings. Below is a Python example utilizing the adb command to enforce fixed screen rotation with the LambdaTest executor:
@@ -148,6 +149,21 @@ params = {"command":"fixed-to-user-rotation", "fixedToUserRotation":True}
result = driver.execute_script("lambda-adb",params)
```
+### Disabling Animations on Android Devices
+Disabling animations can enhance test execution speed by preventing unnecessary visual effects. The following commands are used to disable different types of animations:
+
+- `adb shell settings put global animator_duration_scale 0`: Disables property animation effects, such as object transitions and transformations.
+- `adb shell settings put global transition_animation_scale 0`: Disables window transition animations, making UI transitions instant.
+- `adb shell settings put global window_animation_scale 0`: Disables activity window animations, eliminating fade-in or zoom-in effects.
+
+These commands set the respective global animation scales to 0, effectively disabling animations.
+
+```java
+Map params = Map.of("command", "shell", "text", "settings get global animator_duration_scale");
+androidDriver.executeScript("lambda-adb", params);
+```
+
+