瀏覽代碼

send adb command only to device under tests

Daniel Zlotin 6 年之前
父節點
當前提交
06c38a384f
共有 1 個文件被更改,包括 6 次插入4 次删除
  1. 6
    4
      e2e/init.js

+ 6
- 4
e2e/init.js 查看文件

@@ -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
 }