Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to start activity through adb shell and receive its response? [duplicate]

I know that you can start any exported activity from any app via adb using the following command:

am start -n com.myapp.test/.TestActivity

Using the "am start" command it is also possible to send extra data to the activity (I know how to do this, this is not the question I am asking here!).

However what I need to know is if it is also possible to receive the response data sent back from the started activity when it finishes?

like image 261
Robert Avatar asked Nov 09 '22 16:11

Robert


1 Answers

UPDATE You could print results to logcat. Just start with -W, so it waits for launch to complete

and then do a logcat -d

OP already has understanding for the following. I misread the question, keeping it just in case for somebody else who lands here

To send data to the activity
Please refer here for the intent specification.

You can pass in key value pairs.

To Quote from spec
-e|--es <EXTRA_KEY> <EXTRA_STRING_VALUE> can be used to pass key string-value pair. There are other options to pass in different type of data

like image 181
Mukul Goel Avatar answered Nov 14 '22 22:11

Mukul Goel