Send Intent with adb shell am

FTP client for Android handsets.
Post Reply
tess
Posts: 4
Joined: Thu Jul 15, 2010 4:07 pm
AntiSpam sum: 8

Send Intent with adb shell am

Post 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

support
Posts: 853
Joined: Sun Apr 20, 2008 4:40 pm

Re: Send Intent with adb shell am

Post 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.

tess
Posts: 4
Joined: Thu Jul 15, 2010 4:07 pm
AntiSpam sum: 8

Re: Send Intent with adb shell am

Post 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

support
Posts: 853
Joined: Sun Apr 20, 2008 4:40 pm

Re: Send Intent with adb shell am

Post by support »

great !

tess
Posts: 4
Joined: Thu Jul 15, 2010 4:07 pm
AntiSpam sum: 8

Re: Send Intent with adb shell am

Post 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

support
Posts: 853
Joined: Sun Apr 20, 2008 4:40 pm

Re: Send Intent with adb shell am

Post by support »

Bad address means invalid IP address or valid IP address but with no FTP server running?

tess
Posts: 4
Joined: Thu Jul 15, 2010 4:07 pm
AntiSpam sum: 8

Re: Send Intent with adb shell am

Post 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

Post Reply