Page 1 of 1

Send Intent with adb shell am

Posted: Thu Jul 15, 2010 4:15 pm
by tess
Hi,

I would like send an Intent via adb to download a file from an Host machine (automation tests) using the "activity manager".

Here are the traces :

> adb -s emulator-5554 shell am start -D -a ACTION_PICK -d ftp://192.168.0.50 -t vnd.android.cursor.dir/lysesoft.andftp.uri -es command_type download -es progress_title "Downloading files ..." -es remote_file1 get10k -es local_folder /sdcard/

Starting: Intent { act=ACTION_PICK dat=ftp://192.168.0.50/ typ=vnd.android.cursor.dir/lysesoft.andftp.uri }
Error: Activity not started, unable to resolve Intent { act=ACTION_PICK dat=ftp://192.168.0.50/ typ=vnd.android.cursor.dir/lysesoft.andftp.uri flg=0x10000000 }

Is it possible to do that or the Intent must be sent by an Android application, as it is written in the FAQ ?

Thanks,

Chris

Re: Send Intent with adb shell am

Posted: Fri Jul 16, 2010 5:28 pm
by support
We've never tried with your command but AndFTP does not do any check from source of Intent. So if this command line is similar to Intent call from application then it should work.

Re: Send Intent with adb shell am

Posted: Mon Jul 19, 2010 12:48 pm
by tess
Hi,

now it works, here is the right command:

> adb -s emulator-5554 shell am start -D -a android.intent.action.PICK -d ftp://192.168.0.50 -t vnd.android.cursor.dir/lysesoft.andftp.uri -es command_type download -es progress_title "Downloading files ..." -es remote_file1 get10k -es local_folder /sdcard/

Starting: Intent { act=android.intent.action.PICK dat=ftp://192.168.0.50 typ=vnd.android.cursor.dir/lysesoft.andftp.uri (has extras) }

The mistake was in the format of the Intent action,

Thanks,

Chris

Re: Send Intent with adb shell am

Posted: Sun Jul 25, 2010 2:06 pm
by support
great !

Re: Send Intent with adb shell am

Posted: Wed Jul 28, 2010 1:31 pm
by tess
Hi,

I think I found a bug (it exists on the release 1.8 too).

Using my method to send an Intent via adb (it exists with the startActivity() too), first time, I use the right ftp address and send the Intent => it works. (download succeed)

Second time, I change the ftp address with a bad address and send the Intent => it still works : that is the issue, it should "Fail" !

Maybe, you can have a look on it !

Regards,

Chris

Re: Send Intent with adb shell am

Posted: Sat Jul 31, 2010 8:39 am
by support
Bad address means invalid IP address or valid IP address but with no FTP server running?

Re: Send Intent with adb shell am

Posted: Mon Aug 02, 2010 12:34 pm
by tess
I have the error with a unreachable machine: I selected a IP address that is not used.
But the AndFTP application downloaded the file with the right IP address I had selected before.

Chris