I would like to write tests for Android app with deep link cases using UI testing framework (Espresso) - launch app using only ACTION_VIEW intent and check all views on open
@Rule
public ActivityTestRule activityRule = new ActivityTestRule<>(AppLauncherActivity.class, false, false);
There are multiple constructors for creating an ActivityTestRule. The third one is launchActivity. Set it to false as shown above because you manually start that activity afterwards with activityRule.launchActivity(intent). This should prevent it from starting twice