我的应用包的名称为com.xxx.digital
。
以下工作正常:
❯ 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
但是,以下内容不会:
❯ 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
和
❯ 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
我在这里缺少什么?
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>
答案 0 :(得分:4)
如果使用特殊字符,则必须用引号包装adb shell命令:
adb shell 'am start -W -a android.intent.action.VIEW -d "xxx://?campaign=SG_Smartbanner&af_deeplink=true" com.xxx.digital'