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
Send Intent with adb shell amRe: Send Intent with adb shell amWe'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 amHi,
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 amHi,
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 amBad address means invalid IP address or valid IP address but with no FTP server running?
Re: Send Intent with adb shell amI 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 |