这是一个非常小的不便,但我希望当我开始从 Android Studio 运行我的应用程序时,Android Emulator 会弹出到前面。
我知道模拟器中的“Always on Top”设置,但我在处理代码时必须将模拟器最小化。运行我的应用程序不会恢复模拟器。
最佳答案
遵循@Ves 接受的答案确实有效但更改了批处理文件,因为它对我不起作用,这是我根据另一个答案 https://superuser.com/questions/647216/startup-program-bring-to-foreground 编辑批处理文件 BringProcessToFront.ps1 的方式.
if ( $args ){
$processName = $args[0]
}
else{
$processName = "qemu-system-i386"
}
Add-Type @"
using System;
using System.Runtime.InteropServices;
public class Tricks {
[DllImport("user32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool SetForegroundWindow(IntPtr hWnd);
}
"@
sleep -sec 1
$h = (Get-Process $processName).MainWindowHandle
[void] [Tricks]::SetForegroundWindow($h)
然后我按照接受的答案中的其余步骤进行操作,并且成功了。
关于windows - 从 Android Studio 运行我的应用程序时,我可以强制模拟器到顶部吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52321209/