ADB pull using bash scripts

473 views
Skip to first unread message

Pooi Lum

unread,
Apr 21, 2011, 2:26:24 AM4/21/11
to Robotium Developers
Hey guys,

I have this problem where i am getting errors trying to get the file
out from the mobile to the desktop.

When i do run this command [adb pull $SOURCE $FINALDIRECT/.]. After it
passes through the bash it splits into 2.. if i hardcode the
information it works.. any idea?


adb pull $SOURCE $FINALDIRECT/.

CODES
for (( COUNT = 1 ; COUNT <= $FILESCOUNT ; COUNT++))
do
pwd
CURRENTFILE=`echo $FILELIST | awk '{print $'$COUNT'}'`
echo "Current File $COUNT = $CURRENTFILE"
SOURCE="$MOBILESCREENSHOT"/"$CURRENTFILE"

adb pull $SOURCE $FINALDIRECT/.
done

RESULT:
/home/android/screenshot/20110421
Current File 1 = test_1303350371126.jpg
' does not existsdcard/download/screenshots/test_1303350371126.jpg
/home/android/screenshot/20110421
Current File 2 = test_1303350382275.jpg
' does not existsdcard/download/screenshots/test_1303350382275.jpg
/home/android/screenshot/20110421

Piotr Chłąd

unread,
Apr 21, 2011, 2:42:42 AM4/21/11
to robotium-...@googlegroups.com
Hi

check your sdcard directory. ($MOBILESCREENSHOT it should by
mnt/sdcard.. and directory where you got yours screenshots)

2011/4/21 Pooi Lum <poo...@gmail.com>:

> --
> You received this message because you are subscribed to the Google Groups "Robotium Developers" group.
> To post to this group, send email to robotium-...@googlegroups.com.
> To unsubscribe from this group, send email to robotium-develo...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/robotium-developers?hl=en.
>
>

Pooi Lum

unread,
Apr 21, 2011, 4:33:15 AM4/21/11
to Robotium Developers
Hi Piot,

actually.. thats not the problem...

the main problem is this string "adb pull $SOURCE $FINALDIRECT/. "

Its being displayed as
adb pull $SOURCE
$FINALDIRECT/.

when i run the bash script

On Apr 21, 2:42 pm, Piotr Chłąd <chlad.pi...@gmail.com> wrote:
> Hi
>
> check your sdcard directory. ($MOBILESCREENSHOT it should by
> mnt/sdcard.. and directory where you got yours screenshots)
>
> 2011/4/21 Pooi Lum <pooi...@gmail.com>:

marekdef

unread,
Apr 21, 2011, 4:19:06 PM4/21/11
to Robotium Developers
Hi,

I think you have \r in the variable.
so is like "test_1303350382275.jpg\r"

Run with bash -x and you might see it better.

Pooi Lum

unread,
Apr 21, 2011, 10:54:31 PM4/21/11
to Robotium Developers
Hi Markaf..

I have the \r behind.. how can we remove it?

Regards,
Pooi Lum

Pooi Lum

unread,
Apr 22, 2011, 2:54:07 AM4/22/11
to Robotium Developers
Hey,

I solved it already. Thanks!
Reply all
Reply to author
Forward
0 new messages