Debug app deeplink at launch time

I’m surprised I can’t find how to do this in developer.android.com. After searching high and low, found it. Share with all.

Some Background

Deeplinking from a URL to your App is crucial to getting more people to engage with your App. You could learn about the support below

It taught you how to trigger it using adb command as well.

But how do you debug it?

Simple, start your App in debug mode from Android Studio, and put a breakpoint there waiting for the deeplink to happen when you start your adb command.

But wait… Most of the users would NOT first open up your App, only to open the deeplink later. They would probably be in a state where your App is not alive yet, and deeplink will trigger it to launch.

So how to debug at launch time?

1 Prepare your app launch to wait for your debugger before it proceeds. Run the command below in your console

adb shell am set-debug-app -w…

--

--