@@ -51,5 +51,37 @@ if (-not $AVD_FOUND) {
51
51
}
52
52
53
53
# Start the emulator with user-defined AVD and port
54
- Start-Process - FilePath $EMULATOR_PATH - ArgumentList " -avd $AVD_NAME -writable-system -no-snapshot -wipe-data -port $START_PORT "
55
- Write-Output " Emulator started with AVD $AVD_NAME on port $START_PORT ."
54
+ Start-Process - NoNewWindow - FilePath $EMULATOR_PATH - ArgumentList " -avd $AVD_NAME -writable-system -no-snapshot -wipe-data -port $START_PORT "
55
+ Write-Output " Starting AVD $AVD_NAME on port $START_PORT ."
56
+
57
+ # Wait for the emulator to boot completely
58
+ Write-Output " Waiting for emulator to boot..."
59
+ & $ADB_PATH wait-for - device
60
+ Start-Sleep - Seconds 5
61
+ Write-Output " Emulator booted successfully."
62
+
63
+ # Allow /system remount
64
+ Write-Output " Restarting adb as root..."
65
+ Start-Process - NoNewWindow - Wait - FilePath $ADB_PATH - ArgumentList " root"
66
+
67
+ Write-Output " Disabling AVB verification..."
68
+ Start-Process - NoNewWindow - Wait - FilePath $ADB_PATH - ArgumentList " shell avbctl disable-verification"
69
+
70
+ Write-Output " Disabling verity..."
71
+ Start-Process - NoNewWindow - Wait - FilePath $ADB_PATH - ArgumentList " disable-verity"
72
+
73
+ Write-Output " Restarting emulator..."
74
+ Start-Process - NoNewWindow - Wait - FilePath $ADB_PATH - ArgumentList " reboot"
75
+
76
+ Write-Output " Waiting for emulator to reboot..."
77
+ & $ADB_PATH wait-for - device
78
+ Start-Sleep - Seconds 5
79
+ Write-Output " Emulator rebooted successfully."
80
+
81
+ Write-Output " Restarting adb as root..."
82
+ Start-Process - NoNewWindow - Wait - FilePath $ADB_PATH - ArgumentList " root"
83
+
84
+ Write-Output " Remounting the filesystem..."
85
+ Start-Process - NoNewWindow - Wait - FilePath $ADB_PATH - ArgumentList " remount"
86
+
87
+ Write-Output " Emulator ready for Dynamic Analysis with MobSF."
0 commit comments