A. Abramov
A. Abramov

Reputation: 1859

Calling a ContentProvider custom method with multiple arguments using adb

In an app I am debugging, In a content provider that's exported=true, I have the following method:

public int myMethod(Uri uri, String name) { 
    return name.length;
}

I would like to test it via ADB. I'm not sure how to call it properly with the arguments.

adb shell content call --uri content://my_provider_url/ --method myMethod --arg Hello --arg2 Adam

I've also tried:

adb shell content call --uri content://my_provider_url/ --extra "URI:s:Hello" --extra "NAME:s:Adam"

Didn't work either - I keep getting Result:Null

I wish I could just add bindings - but the code isn't mine. How can I test this provider properly using adb (or a similar tool)?

Upvotes: 2

Views: 945

Answers (0)

Related Questions