Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

adb deep link trigger not working with certain parameters

My app has package name com.xxx.digital.

The following works fine:

❯ adb shell am start -W -a android.intent.action.VIEW -d "xxx://?campaign=SG_Smartbanner" com.xxx.digital 
Starting: Intent { act=android.intent.action.VIEW dat=xxx://?campaign=SG_Smartbanner pkg=com.xxx.digital }
Status: ok
Activity: com.xxx.digital/.views.activities.ProductListingActivity
ThisTime: 827
TotalTime: 1669
WaitTime: 1699
Complete

However, the following do not:

❯ adb shell am start -W -a android.intent.action.VIEW -d "xxx://?campaign=SG_Smartbanner&media_source=Mobilesite" com.xxx.digital 
/system/bin/sh: com.xxx.digital: not found

and

❯ adb shell am start -W -a android.intent.action.VIEW -d "xxx://?campaign=SG_Smartbanner&af_deeplink=true" com.xxx.digital
/system/bin/sh: com.xxx.digital: not found
Starting: Intent { act=android.intent.action.VIEW dat=xxx://?campaign=SG_Smartbanner }
Status: ok
Activity: android/com.android.internal.app.ResolverActivity
ThisTime: 322
TotalTime: 322
WaitTime: 349
Complete

What I'm missing here?

Manifest.xml

<activity
            android:name=".views.activities.DeepLinkActivity"
            android:launchMode="singleInstance"
            android:noHistory="true"
            android:screenOrientation="portrait"
            android:theme="@android:style/Theme.Translucent.NoTitleBar"
            android:windowSoftInputMode="stateAlwaysHidden">

            <!-- custom scheme -->
            <intent-filter
                android:autoVerify="true"
                android:label="@string/app_name">
                <action android:name="android.intent.action.VIEW"/>

                <category android:name="android.intent.category.DEFAULT"/>
                <category android:name="android.intent.category.BROWSABLE"/>

                <data
                    android:scheme="xxx"/>
            </intent-filter>
</activity>
like image 494
ericn Avatar asked Jan 23 '17 03:01

ericn


1 Answers

You must wrap your adb shell command with quotes if you use special chars:

adb shell 'am start -W -a android.intent.action.VIEW -d "xxx://?campaign=SG_Smartbanner&af_deeplink=true" com.xxx.digital'
like image 114
Simon Marquis Avatar answered Sep 27 '22 00:09

Simon Marquis