Page 1 of 1

Batch file for ADB Shell.

Posted: 01 Oct 2014 15:06
by zairyaab
Hi,

I use the following command from CMD Prompt to send a text message through the ABD and phone connected to the machine.
I am looking to replace the number with a list of numbers in text file. Not sure how would it be executed through a batch file. Can someone please help. Thanks.

Code: Select all

adb shell am startservice -e sms_number "0123456789" -e sms_body "SMS TEXT HERE" -n
com.companyname.companyservice/com.companyname.services.SMSSendService


Any help would be highly appreciated.
Thanks

Re: Batch file for ADB Shell.

Posted: 01 Oct 2014 20:16
by foxidrive
One phone number per line in a plain text file:

Code: Select all

@echo off
for /f "usebackq delims=" %%a in ("file.txt") do (
adb shell am startservice -e sms_number "%%a" -e sms_body "SMS TEXT HERE" -n com.companyname.companyservice/com.companyname.services.SMSSendService
)
pause