Parallel tests in a single android device

I have only one android device.
What i wanted to do is to run multiply tests in my single device at the same time. Is it possible?
To be more detailed I want to launch several instances of a web browser simultaneously(via webdriver) with its own desired capabilities of each .
For example each browser instance has its own proxy settings. Is it possible? How to do that?

I’m not sure if you can run all your tests in parallel on a single device. You should treat Appium as a testing tool where all the actions are as if they were performed by a real, human user. If a real human user can not test multiple instances of a web browser in parallel on a single device, then there is no guarantee Appium will be able to do so, either.

Thanks for your reply.
It is possible to run multiple instances of some app on Android. Take at look at this
So I can install,run and test several instances of Google Chrome at the same time as a human user.
So should be an opportunity to do that via appium.
Has anyone got such experience?

I haven’t looked too closely at their method for cloning the application, but my guess is that the tools they suggest simply unpack the APK file, swap out the name, re-sign and re-zipalign the cloned APK. It’s the same way you can modify or reverse engineer existing APKs using apktool, smali, and baksmali. In the context of the Android system, you’re not creating multiple instances of the same app; instead, you have multiple installed applications that just happen to do the same thing with different IDs (after all, the Android system will not allow you to install two applications with the same application ID simultaneously). In any case, this is a rather unusual user case. Appium might be able to replicate this specific flow to creating a cloned APK and installing this new APK, but it will not be able to test the original application and the cloned application simultaneously.

Most Android systems only allow 1 application activity to be in the foreground at a time, so only the UI for 1 of the applications will be available at a time. I don’t believe Appium currently has support for testing applications running on Android systems that allow multiple activities to be in the foreground simultaneously. As a side note, I’ve only come across a handful of devices that have the feature to allow multiple foreground activities; most devices and their systems don’t have this capability.

Thanks Alex for your detailed explanation.
I see now.
It would be better to run test simultaneously on multiple virtual devices created in AVD or in Genymotion, wouldn’t it?

Yes, at least for UI tests, which are the type of tests that Appium is made for.