[英]How to run process with no window
Process.run(
'adb',
['devices],
runInShell: true,
);
When I run the app in android studio, no black window, But when I double-click ***.exe to run the app, it will see the black window当我在android studio中运行app时,没有黑色window,但是当我双击***.exe运行app时,会看到黑色的window
This is a Dart bug .这是一个 Dart 错误。
As described in the comments there , you can work around it for now by creating your own console at launch and hiding it:如那里的评论中所述,您现在可以通过在启动时创建自己的控制台并将其隐藏来解决它:
if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) {
CreateAndAttachConsole();
} else {
AllocConsole();
ShowWindow(GetConsoleWindow(), SW_HIDE);
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.