Actionscript 3 AIR本机进程错误
我尝试在Mac上启动一个带有NativeProcess的程序Actionscript 3 AIR本机进程错误,actionscript-3,apache-flex,air,Actionscript 3,Apache Flex,Air,我尝试在Mac上启动一个带有NativeProcess的程序 pathEV="/Applications/MyFolder/MyAppOSX.app" var nativeProcessStartupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo(); var fileEV:File = new File(); fileEV=fileEV.resolvePath(pathEV); nativeProcessStartupI
pathEV="/Applications/MyFolder/MyAppOSX.app"
var nativeProcessStartupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo();
var fileEV:File = new File();
fileEV=fileEV.resolvePath(pathEV);
nativeProcessStartupInfo.executable = fileEV;
var process:NativeProcess = new NativeProcess();
process.start(nativeProcessStartupInfo);
但这一错误似乎是:
错误#3214:NativeProcessStartupInfo.executable未指定有效的可执行文件
你能帮我解决这个问题吗?
谢谢您是否需要将
扩展桌面
添加到清单文件中
还有,我相信。它实际上只是一个应用程序包,其中存在实际的可执行文件。首先尝试指向
/bin/ls
以确保所有其他操作都正常,然后在.app文件夹中查找可执行文件。尚未对其进行测试,但我假设您需要以应用程序路径作为参数运行open
,如下所示:
pathEV:String="/Applications/MyFolder/MyAppOSX.app"
var nativeProcessStartupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo();
var fileEV:File = new File();
fileEV=fileEV.resolvePath( '/usr/bin/open' );
nativeProcessStartupInfo.arguments = Vector.<String>([pathEV]);
nativeProcessStartupInfo.executable = fileEV;
var process:NativeProcess = new NativeProcess();
process.start(nativeProcessStartupInfo);
pathEV:String=“/Applications/MyFolder/MyAppOSX.app”
var nativeProcessStartupInfo:nativeProcessStartupInfo=new nativeProcessStartupInfo();
var fileEV:File=new File();
fileEV=fileEV.resolvePath('/usr/bin/open');
nativeProcessStartupInfo.arguments=向量([pathEV]);
nativeProcessStartupInfo.executable=fileEV;
var进程:NativeProcess=new NativeProcess();
进程启动(nativeProcessStartupInfo);
是的,这肯定需要extendedDesktop
权限
仅供参考:Vector shizzle是正确的,我使用它将数组转换为Vector,而不是作为构造函数
为什么需要nativeProcess?为什么不直接使用fileEV.openWithDefaultApplication()?我还在清单文件中添加了extendedDesktop。在MacOs上,应用程序就像一个可执行文件,试着测试一下你的想法。谢谢