in src/main/kotlin/com/uber/nanoscope/Nanoscope.kt [201:222]
fun launchEmulator(emulatorUrl: String) {
val md5 = MessageDigest.getInstance("MD5").digest(emulatorUrl.toByteArray())
val key = Base64.encode(md5)
val outDir = File(configDir, "roms/$key")
downloadZipIfNecessary(outDir, emulatorUrl)
val launchScript = File(outDir, "emulator.sh")
if (!launchScript.exists()) {
throw FlashException("Invalid Nanoscope emulator. emulator.sh script does not exist.")
}
launchScript.setExecutable(true)
println("Launching emulator...")
ProcessBuilder("./emulator.sh")
.directory(outDir)
.inheritIO()
.start()
.waitFor()
}