mirror of
https://github.com/hanzoai/Detox.git
synced 2026-09-24 16:55:12 +00:00
57 lines
2.0 KiB
Plaintext
57 lines
2.0 KiB
Plaintext
```plain text
|
||
18:26:07.024 detox[45214] i Waiting for you to manually launch your app in Android Studio.
|
||
|
||
Instrumentation class: com.wix.detox.test.test/com.example.DetoxTestAppJUnitRunner
|
||
Instrumentation arguments:
|
||
------------------------------------
|
||
Key | Value
|
||
------------------------------------
|
||
detoxServer | ws://localhost:8099
|
||
detoxSessionId | test
|
||
------------------------------------
|
||
|
||
Press any key to continue...
|
||
```
|
||
|
||
Now it is time to switch back to Android Studio. You’ll need to run your instrumentation runner with the said arguments,
|
||
this is why you should create a debug configuration of `Android Instrumented Tests` type similar to the one below:
|
||
|
||

|
||
|
||
Make sure to put breakpoints at the points of interest before you start the app.
|
||
|
||
After the app is launched, go back to the Terminal where Detox is running and press any key.
|
||
As a result, you are expected to see a confirmation from Detox, e.g.:
|
||
|
||
```plain text
|
||
Found the app (com.wix.detox-example) with process ID = 16854. Proceeding...
|
||
```
|
||
|
||
Now the entire test will run as usual until it sends an action to the app, which gets trapped
|
||
in your breakpoint.
|
||
|
||

|
||
|
||
Happy debugging!
|
||
|
||
P.S. If you see this timeout error too often while debugging:
|
||
|
||
```plain text
|
||
Waited for the new RN-context for too long! (60 seconds)
|
||
If you think that’s not long enough, consider applying a custom Detox runtime-config in DetoxTest.runTests().
|
||
```
|
||
|
||
you can temporarily hack the timeout here:
|
||
|
||
```diff title="detox/android/detox/src/main/java/com/wix/detox/config/DetoxConfig.kt"
|
||
package com.wix.detox.config
|
||
|
||
class DetoxConfig {
|
||
@JvmField var idlePolicyConfig: DetoxIdlePolicyConfig = DetoxIdlePolicyConfig()
|
||
- @JvmField var rnContextLoadTimeoutSec = 60
|
||
+ @JvmField var rnContextLoadTimeoutSec = Int.MAX_VALUE
|
||
|
||
fun apply() {
|
||
idlePolicyConfig.apply()
|
||
```
|