An error will be reported when script.load() is called.
{'type': 'error', 'description': 'Error: VM::AttachCurrentThread failed: -1', 'stack': 'Error: VM::AttachCurrentThread failed: -1
at o (frida/node_modules/frida-java-bridge/lib/result.js:4)
at <anonymous> (frida/node_modules/frida-java-bridge/lib/vm.js:27)
at <anonymous> (frida/node_modules/frida-java-bridge/lib/vm.js:15)
at it (frida/node_modules/frida-java-bridge/lib/android.js:521)
at ze (frida/node_modules/frida-java-bridge/lib/android.js:202)
at Oe (frida/node_modules/frida-java-bridge/lib/android.js:16)
at _tryInitialize (frida/node_modules/frida-java-bridge/index.js:29)
at _ (frida/node_modules/frida-java-bridge/index.js:21)
at <anonymous> (frida/node_modules/frida-java-bridge/index.js:332)
at call (native)
at o (/_java.js)
at <anonymous> (/_java.js)
at <anonymous> (frida/runtime/java.js:1)
at call (native)
at o (/_java.js)
at r (/_java.js)
at <eval> (frida/runtime/java.js:3)
at _loadJava (native)
at get (frida/runtime/core.js:130)
at <eval> (/script1.js:30)', 'fileName': 'frida/node_modules/frida-java-bridge/lib/result.js', 'lineNumber': 4, 'columnNumber': 1}
Workaround https://github.com/frida/frida/issues/1788
https://stackoverflow.com/questions/36680128/frida-spawn-process-failed-on-android
1. may also require device.resume()
2.
su
setprop persist.device_config.runtime_native.usap_pool_enabled false
getprop | grep usap
3. Do not have spaces in the path