How to run an app on MacOS platform using QProcess in appliacation's Contents/MacOS?
-
I want to run an application using QProcess(Qt6.1). But it does not work well. The application can not be run.
The application's path is:
/Applications/Wireshark.app/Contents/MacOS/text2pcap
The code is:
QProcess* process = new QProcess(this);
QString text2capPath = WiresharkUtils::getRunningAppPath(APP_NAME_TEXT2CAP);
QStringList argsList;
argsList << tmpFilePath << storagePath;
process->startDetached(text2capPath, argsList);
process->waitForStarted();value of vars
-->
var : text2capPath
/Applications/Wireshark.app/Contents/MacOS/text2pcapvar tmpFilePath:
/private/var/folders/2w/zcqw02ns0pv6ntfdn6gtp4rc0000gn/T/pcap_file__2021-06-24-14-29-00.txtvar storagePath:
/Applications/Wireshark.app/Contents/MacOS/text2cap -
But it does not work well
- well what does that mean exactly?
- also connect to the errorOccured signal to get more information about the error
-
I mean the new outside program “/Applications/Wireshark.app/Contents/MacOS/text2pcap” can not be run.There is no error information reported.
But if I change the another path "/Applications/Wireshark.app" to be called, it run ok. -
@angelyouyou said in How to run an app on MacOS platform using QProcess in appliacation's Contents/MacOS?:
There is no error information reported
Please show how you use errorOccured