Browse Source

send adb command only to device under tests

Daniel Zlotin 6 years ago
parent
commit
06c38a384f
1 changed files with 6 additions and 4 deletions
  1. 6
    4
      e2e/init.js

+ 6
- 4
e2e/init.js View File

@@ -11,9 +11,11 @@ after(async () => {
11 11
   await detox.cleanup();
12 12
 });
13 13
 
14
-// Temporary solution, #2809
15 14
 function disableAndroidEmulatorAnimations() {
16
-  exec.execAsync(`adb shell settings put global window_animation_scale 0.0`);
17
-  exec.execAsync(`adb shell settings put global transition_animation_scale 0.0`);
18
-  exec.execAsync(`adb shell settings put global animator_duration_scale 0.0`);
15
+  if (device.getPlatform() === 'android') {
16
+    const deviceId = device._deviceId;
17
+    exec.execAsync(`adb -s ${deviceId} shell settings put global window_animation_scale 0.0`);
18
+    exec.execAsync(`adb -s ${deviceId} shell settings put global transition_animation_scale 0.0`);
19
+    exec.execAsync(`adb -s ${deviceId} shell settings put global animator_duration_scale 0.0`);
20
+  }
19 21
 }