title: Android Deep Linking with custom URI
body: <p>I have the following defined in my manifest:</p>
  
  <pre><code>&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.app.package"&gt;
  ...
      &lt;activity
          android:name="app.myActivity"
          android:label="@string/app_name"
          android:screenOrientation="portrait"&gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.VIEW" /&gt;
  
              &lt;category android:name="android.intent.category.DEFAULT" /&gt;
              &lt;category android:name="android.intent.category.BROWSABLE" /&gt;
              &lt;data
                  android:host="www.example.com"
                  android:pathPrefix="/gizmos"
                  android:scheme="http" /&gt;
              &lt;!-- note that the leading "/" is required for pathPrefix--&gt;
              &lt;!-- Accepts URIs that begin with "example://gizmos”--&gt;
              &lt;data
                  android:host="gizmos"
                  android:scheme="example" /&gt;
          &lt;/intent-filter&gt;
      &lt;/activity&gt;
   ...
  </code></pre>
  
  <p>And I have defined my onCreate() as such:</p>
  
  <pre><code>@Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
  
      Intent intent = getIntent();
      Uri data = intent.getData();
      if (data != null) {
          Log.d("URI",data.toString());            
      }
  }
  </code></pre>
  
  <p>This is in accordance with the Android documentation: <a href="http://developer.android.com/training/app-indexing/deep-linking.html" rel="noreferrer">Android Deep Linking</a></p>
  
  <p>So the question is:</p>
  
  <p><b>How do I test the URI deep linking? According to the documentation I run something like</b></p>
  
  <blockquote>
    <p>adb shell am start
            -W -a android.intent.action.VIEW
            -d "example://gizmos" com.app.package</p>
  </blockquote>
  
  <p>But this produces:</p>
  
  <blockquote>
    <p>Error: Activity not started, unable to resolve Intent { act=android.intent.action.VIEW dat=example://gizmos flg=0x10000000 pkg=com.app.package }</p>
  </blockquote>
  
  <p>I have also tried the shell with the name and reference of the activity, the launcher activity and left the package blank. The only one I can get to work is:</p>
  
  <blockquote>
    <p>adb shell am start -W -a android.intent.action.VIEW -d "<a href="http://www.example.com/gizmos" rel="noreferrer">http://www.example.com/gizmos</a>"</p>
  </blockquote>
  
  <p>But even if I got this going that isn't to say it's going to work within other apps. CUSTOM URI's (e.g. example://gizmos) are not clickable in other apps like Gmail and WhatsApp - so testing within the Android ecosystem is also problematic.</p>
  
  <p>The answer <a href="https://stackoverflow.com/questions/25733872/trying-to-enable-deep-linking-to-android-app-testing-intent-cant-launch-activi">at this stack overflow question</a> is not acceptable since it does not answer the question but rather just encourages the use of the http:// version, I want the example:// scheme to work.</p>