How do I convert the following Java code to an ADB command?

Intent intent = new Intent(Intent.ACTION_VIEW);
intent.putExtra("startFromWS", true);

The only thing I've seen so far is

adb shell am start -n com.package.name/com.package.name.ActivityName

1 Answer 1


The Android developer documentation explains how to specify an intent in the argument to the am command.

In your case you want -a to specify the action, -d to specify the data URI, and --ez to specify a Boolean extra. You can find the action name by looking up Intent.ACTION_VIEW in the documentation. Putting all of that together, you get:-

am start -a android.intent.action.VIEW -d com.glass.videoglass:// --ez startFromWS true

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .