Dmitrii Leonov
Posted on July 18, 2022
Most of the time, it is quite simple to debug a deep link just run your app start attach debugger, and fire a deep link, it is straightforward and can be done without any adb command.
But what if you need to start an app with a deep link/app link? How do you attach the debugger then? Well, it's time for adb.
1. Run this command once, so that your app will be waiting for the debugger to be attached before starting it.
adb shell am set-debug-app -w --persistent <com.app.package>
2. Trigger your deep link specifying activity that has an intent filter to recognize deep link sheme
adb shell am start -W -a android.intent.action.VIEW -d "<your-deep-link-url>" <com.app.package>.<your-activity-that-handle-intent>
n. Once done, remove the effect applied by step #1
adb shell am clear-debug-app <com.app.package>
More concrete example
adb shell am set-debug-app -w --persistent com.example.myapp
adb shell am start -W -a android.intent.action.VIEW -d "https://my-app-host-link.com/detail_screen_path?id=100" com.example.myapp.MainActivity
adb shell am clear-debug-app com.example.myapp
💖 💪 🙅 🚩
Dmitrii Leonov
Posted on July 18, 2022
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
android Quick example of creating a custom Kotlin coroutine and scoping it to a Android service.
November 21, 2024