LAUNCH EXTERNAL PROCESS (Why does "errorStream" argument return all info?)

701.en.html> LAUNCH EXTERNAL PROCESS> 4D command has these

( fileName {; inputStream {; outputStream {; errorStream}}}{; pid} )

Why is all information returned in the errorStream parameter instead
of the outputStream parameter, when I use the “xcrun altool
–notarization-info” command?

So calling:

<code 4D>
$explain_c.push(New object(“start”;String(Current time;HH MM

$command_t:=“xcrun altool --notarization-info”
+"–username “”"
+"–password “@keychain:altool-notarize”"

LAUNCH EXTERNAL PROCESS($command_t;$input_t;$output_t;$error_t)

$explain_c[0].end:=String(Current time;HH MM SS)
$explain_c.push(New object(“OK”;OK))
$explain_c.push(New object("$input_t";$input_t))
$explain_c.push(New object("$output_t";$output_t))
$explain_c.push(New object("$error_t";$error_t))
$explain_c.push(New object("$command_t";$command_t))
</code 4D>

returns the reply in the errorStream (ie, $error_t). The outputStream
(ie, $output_t) is an empty string.

Here’s what $explain_c reports. Note all information sent back is in
$error_t. But no errors occurred (see red):

“start”: “10:09:55”,
“end”: “10:10:00”
“OK”: 1
“$input_t”: “”
“$output_t”: “”
“$error_t”: “2019-07-05 10:10:00.337 altool[840:57217] No
errors getting notarization info.\n\n RequestUUID:
118fcb15-5d88-40e3-a0cd-c139313b9895\n Date: 2019-07-05
01:33:24 +0000\n Status: success\n LogFileURL:
n Status Code: 0\nStatus Message: Package Approved\n”
“$command_t”: “xcrun altool --notarization-info
118fcb15-5d88-40e3-a0cd-c139313b9895 --username” --password “@keychain:altool-notarize””

Why – when there are no errors – is the reply returned in the errorStream argument? (I would have thought the reply would appear in the outputStream.)


I don’t know much about the xcrun tool. But it could be that this tool returns all output into the error stream.
You can easily test this e.g.

If you see any output in the 2nd case only, xcrun uses the error stream only.



xcrun is a redirection utility that finds CLI tools inside Xcode.

it is not uncommon for developer to have multiple versions of Xcode installed,
or one installed in a non-standard directory.

I agree that it is the CLI program (altool in this example)
that decides what to print in stdErr and what to print in stdOut.
LAUNCH E. P. is simply echoing the output.

some commands prefer to use stdErr to report progress, not error,
presumably to prevent stdOut from being clogged with information.

by the way, altool creates its own log file in ~/Library/Application Support/altool/