0

Run with Terminal is correctly executing:

alexMaxBook-Pro:ios alex$ ./ios_minicap --udid 214fce468bacae09fffe0d857ea5452548198b1b8 --port 12345 --resolution 320x568
EnableDALDevices
2019-12-19 19:22:35.382 ios_minicap[63539:3200518] Available devices:
2019-12-19 19:22:35.382 ios_minicap[63539:3200518] 214fce468bacae09fffe0d857ea5452548198b1b8
2019-12-19 19:22:35.383 ios_minicap[63539:3200518] DJH438115P8F6VTDV
resolution: 320x568
Allocating 555008 bytes for JPEG encoder
== Banner ==
version: 1
size: 24
pid: 63539
real width: 320
real height: 568
desired width: 320
desired height: 568
orientation: 
quirks: 1
banner: 11833f8004010038200401003820001

Running with python, the program doesn't work properly, and it's missing output: How to get the same effect?

cmd = './ios_minicap --udid 214fce468bacae09fffe0d857ea5452548198b1b8 --port 12345 --resolution 320x568'
p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)
out, err = p.communicate()
for line in out.splitlines():
    print(line)
>>
2019-12-19 19:36:34.492 ios_minicap[63632:3206871] Available devices:
2019-12-19 19:36:34.492 ios_minicap[63632:3206871] 214fce468bacae09fffe0d857ea5452548198b1b8
2019-12-19 19:36:34.492 ios_minicap[63632:3206871] DJH438115P8F6VTDV
b'EnableDALDevices'
Alex
  • 63
  • 7
  • `subprocess.run(cmd, check=True, shell=True, executable='/bin/bash')` Do you need to record the Output? – DUDANF Dec 19 '19 at 11:52
  • Is it possible that you have something in the err? Add "stderr=subprocess.PIPE" to the Popen as well and check the err value. – Amiram Dec 19 '19 at 12:13
  • @mirana I don't want to record Output.I try the way you showed me: ```subprocess.CalledProcessError: Command 'ios_minicap --udid 214fce468bacae0998f0d857ea5452548198b1b8 --port 12345 --resolution 320x568' returned non-zero exit status 1.``` – Alex Dec 20 '19 at 03:05
  • @Amiram stderr=subprocess.PIPE is no data – Alex Dec 20 '19 at 03:11
  • Please have a look at the following link on how to execute commands (scripts) from your script. https://stackoverflow.com/questions/59358917/how-to-run-a-script-within-another-script/59359102#59359102 Let us know if you are still having problems. – Amiram Dec 20 '19 at 09:13
  • @Alex in this output, haven't you missed out on the `./` from `./ios_minicap ...` – DUDANF Dec 20 '19 at 09:57
  • @Alex also! Unless this script and `ios_minicap` are in the same directory, this will not work. Maybe try giving in an asbolute path? `./path/to/ios_minicap ...` – DUDANF Dec 20 '19 at 09:58

0 Answers0