How can I deliver parameters to a test function, that launched using adb shell am Instrumentation command

Viewed 41203

I am developing in Android, I am using instrumentation to test Phone application. Instrumentation is Android env to test applications.

For that I use am command with name of test case. I run adb, then I enter adb shell, then write in shell the am command.

I wish to deliver a parameter together with this am command. I mean that I wish to deliver parameters to the test launched by the am command.

Is it possible ??? Please help ?

5 Answers

to send extra value you should add -n(Component) for sending extra value with -e

here is the sample to sent multiple key-value

adb shell am start -n com.example.jk.checkwifi/.MainActivity -e "imei" $myimei -e "ip" $IP

then to get data inside activity, get like this inside onCreate

ip = intent.getStringExtra("ip")
Related