setMain

@ExperimentalCoroutinesApi fun Dispatchers.setMain(
    dispatcher: CoroutineDispatcher
): Unit

Sets the given dispatcher as an underlying dispatcher of Dispatchers.Main. All consecutive usages of Dispatchers.Main will use given dispatcher under the hood.

It is unsafe to call this method if alive coroutines launched in Dispatchers.Main exist.