Closed fatahillahardhi closed 1 year ago
You will have to kill the Java process
that started the thread.
You could use a tool like VisualVM to monitor the processes or just kill it directly from the cmd / terminal.
I just found the solution without using VisualVM or kill from cmd/terminal (because the Appium randomly hanging/idle).
I create a new Thread for listening Thread from Courgette, when it's hanging it will be stop the Appium.
How do I stop a specific thread? I have a problem on a real iOS device where I use 2 real devices, sometimes one of the devices becomes stuck when running automation and I have to kill all Appium ports (manual from terminal) to be automatically re-run it again. So far, I only knows how to get thread name with the code:
But I don't know how to stop a thread. For example, there are 2 threads running:
For pool-1-thread-2, it runs normally, but when pool-1-thread-1 freeze/stuck, I want to stop the pool-1-thread-1 to be able to re-run it again.