To enable developer options, tap the Build Number option 7 times. You can find this option in one of the following locations, depending on your Android version:
Android 9 (API level 28) and higher: Settings > About Phone > Build Number
- Enable Wireless Debugging: Settings > search Wireless Debugging.
- Pick Pair device with pairing code option.
- Run
adb pair <ip>:<port> <pairing code>(showed in the Pair with device dialog shown after picking above option). For example:
adb pair 192.168.1.123:41000 123456
- Run
adb connect <ip>:<port>.
Note:
The port for pairing and connecting may be different. The port for connecting is listed at IP address & Port in Wireless Debugging panel (see above screenshot, first red square)
adb connect 192.168.1.123:41001
Confirm that it works by running adb devices:
List of devices attached
192.168.1.123:41001 device
adb-random-text._adb-tls-connect._tcp. device

The following code will trigger the specific system intent from your app:
import android.content.Context
import android.content.Intent
import android.provider.Settings
import android.widget.Toast
fun openWirelessDebuggingSettings(context: Context) {
// Intent for direct Wireless Debugging Screen (Android 11+)
val wirelessDebugIntent = Intent("android.settings.WIRELESS_DEBUGGING_SETTINGS")
}