How to click on Home button on android device if we are working with multiThreading for multiple device

I’m executing script for multiple devices with multithreading its working fyn with me, but issue is when I press Home Tab in android device its only work for sigle device.
Plz help me Out.
and also how to get Excel reporting to set values for differeny devices as devices executing through multithreading
and am seting value in excel sheet with getRow count of sheet but everytime it work for 1 device only.

I can answer your first question :wink:

You can use adb commands and in that you can specifically mention device’s serial id(in adb devices). You can simulate any android button using command “adb shell input keyevent”, For example:
To press Home button on your android device: “adb -s XXX shell input keyevent KEYCODE_HOME”, where XXX is your device’s id.

But problem is my whole code is running through multithreading with framework every element get executed with single script bu this home tan press is only work for 1 thread but not for other one.

Got it, But will not be able to help you unless you explain your framework little bit more.

I am creating a Multithreading in loop count execute after getting data from excel sheet in excel sheet I have mentioned all the devices info and apppium port and udid in sheet.for each device i am invoking appium url in loop and start thread in loop so that each device get started on differeny appium port and in run method with loop am setting capabilities for each devices AND in same run method am creating testNG class so that it excute each testng class which I mention for different app.
and am executing each app 1 after another so to do I have to minimize the app which get executed so that nxt can proceed. but this minimization only work for 1 device