我在Android Studio中启动了一个新项目,并将其添加到我的androidmanifest.xml中
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data
android:host="www.example.com"
android:pathPrefix="/gizmos"
android:scheme="http"/>
</intent-filter>
</activity>然后我在谷歌浏览器上输入:http://www.example.com/gizmos。应用程序无法打开。然后尝试使用命令行:
mac-van-jim:DeeplinkTest jimclermonts$ adb shell am start -n eu.theappfactory.deeplinktest/MainActivity
Starting: Intent { cmp=eu.theappfactory.deeplinktest/MainActivity }
Error type 3
Error: Activity class {eu.theappfactory.deeplinktest/MainActivity} does not exist.还有这一条:
mac-van-jim:DeeplinkTest jimclermonts$ adb shell am start -W -a android.intent.action.VIEW -d "http://www.example.com" eu.theappfactory
Starting: Intent { act=android.intent.action.VIEW dat=http://www.example.com/... pkg=eu.theappfactory }
Error: Activity not started, unable to resolve Intent { act=android.intent.action.VIEW dat=http://www.example.com/... flg=0x10000000 pkg=eu.theappfactory }我试过这些帖子:
Deep Link does not work on Android
Android deep linking is not working
Deep-linking intent does not work
什么都不能用?我还记得这个曾经有效吗?也许是因为新的Android应用链接?
编辑:我发现它不能在Chrome上运行,但在创建和上传网页时,它也不能工作:
<!DOCTYPE html>
<html>
<head>
<body>
<a href="Click here" target="_blank">http://www.example.com/gizmos</a>
</body>
</head>
</html>发布于 2020-03-31 04:41:57
要使用提供的url启动您的应用程序,您应该运行以下命令:
adb shell "am start 'http://www.example.com/gizmos'"此外,Chrome的设计是,如果你复制/粘贴URL搜索栏中的链接,就不会打开你的应用程序。
https://stackoverflow.com/questions/60792023
复制相似问题