SUT uiautomator dump

I have connected SUT with androidgateway. So VNC server is running in SUT. I need take a screen xml dump like we use ‘adb shell uiautomator dump’ with adb tool. I can’t use this adb command in script, Because a process already running in SUT. Is there any way I can take ui xml dump through script !?