I am trying to test android deep link urls through adb to launch my app

前端 未结 11 787
孤街浪徒
孤街浪徒 2021-01-30 10:07

When I type the command in adb:

./adb shell am start -W -a android.intent.action.VIEW -d \"example:gizmos\" com.myapp

I get this error:

11条回答
  •  轮回少年
    2021-01-30 10:46

    I found Savas Adar's answer the most friendly to use, also makes much more sense to have an inbuilt tool for that purpose.

    Just use that!

    I have three quick disclaimers about the App Links Assistant which are missing in his answer and a comment was too long.

    1. Open App Links Assistant. I couldn't find it in the Tools menu. So double press Shift and type App Link Assistant to run it from Android Studio

    2. Pressing "Run Test" would clear the edit text box so I found myself having to copy and paste my link every time I wanted to re-try the test. Foolish of myself not reading the text literally above it saying that after running a test a Run Configuration gets created with the previous url attached to it. (Top of the screen, left of the device menu). Just select the run configuration with the url you want.

    3. I found that pressing "Run Test" would restart the app unlike the ABD approach which is no biggie (just slower) until I wanted to debug. I ran the app in the debug mode and then pressed Run Test which would stop my debugging sessions and restart the app...

    Solution is to choose the Run Configuration from point 2, and just run it as a debug.

提交回复
热议问题