How can i test syncing or sharing, Can please any one suggest?

Can any one suggest how to run different script on two devices during parallel execution.
I am working on Android and want to test sharing like a chat system.
First login in both device with different credential and then one send a message to another and second device verify message receive or not ?.