androidtestingcommand-lineadbdeeplink

The deeplink is not opened properly when I run it via Terminal with ADB


This is my deeplink: example://editor?photo-id=217762275004202&component=crop

In the deeplink it is shown that should open app then open photo then crop tool

When I copy this into terminal line it opens only photo. The crop tool does not open (This part of deeplink does not work: - &component=crop )

adb shell am start -W -a android.intent.action.VIEW -d example://editor?photo-id=217762275004202&component=crop 

Also, when I click on the deeplink right from device it opens properly but from command line - not! .

What is the problem?


Solution

  • You must use quotes to properly escape special characters:

    adb shell 'am start -W -a android.intent.action.VIEW -d "example://editor?photo-id=217762275004202&component=crop"'