You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
private void launchScrcpy(String mirrorPath, Project project)
{
VirtualFile file = LocalFileSystem.getInstance().findFileByIoFile(new File(mirrorPath));
if (file == null) {
JOptionPane.showMessageDialog(null, "The selected file maybe moved or removed. \n\nSelect the path again by Tools -> Side Mirror -> Choose Mirror Path option.", "Error", JOptionPane.ERROR_MESSAGE);
showChoosePathDialog(project);
return;
}
String[] cmd = { mirrorPath };
try {
if (OsUtils.getOperatingSystemType() == OsUtils.OSType.Windows)
{
Process p = Runtime.getRuntime().exec(cmd);
}
else if (OsUtils.getOperatingSystemType() == OsUtils.OSType.MacOS)
{
ProcessBuilder processBuilder = new ProcessBuilder("open", mirrorPath);
Process p = processBuilder.start();
int exitCode = p.waitFor();
}
else if (OsUtils.getOperatingSystemType() == OsUtils.OSType.Linux)
{
ProcessBuilder processBuilder = new ProcessBuilder("bash", "-c", mirrorPath);
Process p = processBuilder.start();
p.waitFor();
}
else
{
JOptionPane.showMessageDialog(null, "Side Mirror is not supported on your OS currently.", "Error", JOptionPane.ERROR_MESSAGE);
}
}
catch (IOException e) {
e.printStackTrace();
JOptionPane.showMessageDialog(null, "The selected file seems not be the correct type. \n\nSelect the path again by Tools -> Side Mirror -> Choose Mirror Path option.", "Error", JOptionPane.ERROR_MESSAGE);
showChoosePathDialog(project);
} catch (InterruptedException e) {
e.printStackTrace();
JOptionPane.showMessageDialog(null, "The selected file seems not be the correct type. \n\nSelect the path again by Tools -> Side Mirror -> Choose Mirror Path option.", "Error", JOptionPane.ERROR_MESSAGE);
showChoosePathDialog(project);
}
}
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: