I was trying to get the information of all ios real devices (connected to my machine) and also the simulators.
import subprocess
def getdeviceinfo(self):
alldevicesinfo = subprocess.run(['xcrun', 'xctrace', 'list', 'devices'], stdout=subprocess.PIPE).stdout.decode(
'utf-8')
The above process gives me the o/p as an empty string but, gives the expected information in stderr (in the error)
Try the below code:
alldevicesinfo = subprocess.run(['xcrun', 'xctrace', 'list', 'devices'], stderr=subprocess.PIPE).stderr.decode(
'utf-8')