I am writing a simple python script using Subprocess to get iDevices list attached to my mac. The command I am using is "instruments -s devices". This command works fine when I run through the command line but I am having issues when I use the same command using subprocess.
Below is my simple python script
import subprocess
cmd = ['instruments', '-s', 'devices']
response = subprocess.Popen(cmd,stdout=subprocess.PIPE)
print response.communicate()
My terminal screen looks as below when I run the above python command
MacBook-Pro-9:lib darren$ python iOSRemoteLib.py
2016-09-05 14:30:38.648 instruments[21276:1052546] WebKit Threading Violation - initial use of WebKit from a secondary thread.
The python process gets hung up and not returning any response. Looks like some threading issue and I am not able to figure out what.
Thanks