Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to pass intent data when starting app via adb [duplicate]

Tags:

android

adb

I am able to start an activity with adb as below

adb shell am start -a android.intent.action.MAIN -n com.package.name/com.package.name.ActivityName

How do I add intent data to this command so that I can retrieve it from the started activity?

like image 701
kev Avatar asked Mar 07 '18 18:03

kev


1 Answers

Here is some sample commands :

# specifying the action and data uri
adb shell am start -a "android.intent.action.VIEW" -d "http://developer.android.com"

# specifying the action, mime type and an extra string 
adb shell am start -a "android.intent.action.SEND" --es "android.intent.extra.TEXT" "Hello World" -t "text/plain"

# specifying an explicit component name 
adb shell am start -n "com.example.application/.MainActivity"

The application With intent allow to send intent.

I found those informations there : http://www.xgouchet.fr/android/index.php?article42/launch-intents-using-adb

like image 68
Mickael B. Avatar answered Oct 20 '22 17:10

Mickael B.