Var*_*ani 44 android deep-linking adb
我正在尝试深层链接我的应用程序,并在我的AndroidManifest.xml中实现了以下内容以打开正确的活动.
<activity
android:name=".ui.activities.MyActivity"
android:label="@string/title_activity"
android:screenOrientation="portrait">
<!-- ATTENTION: This intent was auto-generated. Follow instructions at
https://g.co/AppIndexing/AndroidStudio to publish your Android app deep links. -->
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<!-- ATTENTION: This data URL was auto-generated. We recommend that you use the HTTP scheme.
TODO: Change the host or pathPrefix as necessary. -->
<data
android:host="myHost"
android:scheme="myCustomScheme" />
</intent-filter>
</activity>
Run Code Online (Sandbox Code Playgroud)
我正在使用adb测试活动
adb shell am start -W -a android.intent.action.VIEW -d "myCustomScheme://myHost?key=category_parent_id&value=92&title=test" com.myApp.android
Run Code Online (Sandbox Code Playgroud)
Activity正在打开,但只传递给intent中活动的URI
myCustomScheme://myHost?key=category_parent_id
Run Code Online (Sandbox Code Playgroud)
它在"&"后跳过一切
我确实在SO上查找但没有找到任何有多个查询参数的东西.
任何帮助,将不胜感激.:)
Sim*_*uis 16
您可以使用简单的引号包装shell命令(以避免修改uri内容):
adb shell 'am start -d "myCustomScheme://myHost?key=category_parent_id&value=92&title=test"'
Run Code Online (Sandbox Code Playgroud)