You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

在Android Studio中使用Firebase Test Lab,Test Timeout设置为何找不到?

Answer

Great question—this is a common gotcha with older Android Studio versions and Firebase Test Lab, so you’re definitely not missing something obvious!

To cut to the chase: Android Studio 3.1.1 does NOT have a built-in UI setting for Test Timeout in the run configuration editor when launching Firebase Test Lab instrumented tests. The web interface exposes more advanced controls that weren’t mirrored in the older Firebase plugin’s UI for Android Studio at the time.

That said, you still have two solid ways to set this timeout value when running tests directly from Android Studio:

1. Define the timeout in your Gradle build file

You can add the timeout setting directly to your app module’s build.gradle file using the Firebase Test Lab Gradle extension. Drop this block into your app-level build.gradle (it can be a top-level block or nested inside the android block, depending on your project structure):

firebaseTestLab {
    // Use format: number + unit (s = seconds, m = minutes, h = hours)
    timeout = "25m" // Adjust to your preferred threshold
}

Once this is added, any time you run your Firebase Test Lab tests via Android Studio’s run configurations, the underlying Gradle task will automatically pass this timeout value to Firebase.

2. Pass the timeout as a dynamic Gradle argument

If you don’t want to hardcode the timeout in your build file, you can modify your Android Studio run configuration to include it as a command-line parameter:

  • Open your run configuration (go to Run > Edit Configurations)
  • Locate the Gradle run config for your Firebase Test Lab tests
  • In the Arguments field, add this line:
    -PfirebaseTestLabTimeout=25m
    
    To make this work, update your build.gradle to read this property (with a fallback default):
    firebaseTestLab {
        timeout = project.findProperty("firebaseTestLabTimeout") ?: "15m" // Fallback if no argument is passed
    }
    
    This lets you adjust the timeout on the fly without editing your build file every time.

One quick side note: Newer versions of Android Studio (released after 3.1) and the updated Firebase Test Lab plugin do include a UI option for setting test timeout directly in the run config. But since you’re on 3.1.1, the Gradle-based workarounds above are the way to go.

内容的提问来源于stack exchange,提问作者John W

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.25 08:34:54