0

Need to send by shellscript every new string in Android logcat by curl POST command to server. Connected to Android by ADB. I was trying this things:

#logcat com.mm.en:I -e "chat"| tee /sdcard/Pictures/out.txt

It makes a file, and write every new string to it. Next i was trying:

#curl -i -H "Accept: application/json" -H "Content-Type: application/json" -X POST http://nnnn.ru/test/testprint.php -G -d '{"id":"IDVALUE","name":"Mike"}'

It is also work. But when i trying to combine it by guide, it doesnt work:

#logcat com.mm.en:I -e "chat"| curl -H 'Content-Type: application/json' http://nnnn.ru/test/testprint.php -d @-

Where i`m wrong?

Dru44
  • 1
  • Could you clarify what is actually happening in "logcat ... | curl ..."? Nothing is sent? What happens if you replace the logcat with "echo 'trial'? Could be that curl is waiting for the end of the input? – Comnir Feb 27 '21 at 17:14
  • Yes, in construction above nothing is sent. Now u use this: curl -X POST http://nnnn.ru/test/testprint.php -F "$(logcat com.mm.en:I -e "chat" -v raw)" It send what i need, but only when i stop execution. Does not send every line separated "on-line" – Dru44 Mar 01 '21 at 08:12

0 Answers0