Device.spawn() times out, despite successfully launching app
Hi there,
I'm using Frida 14.2.14 against an A13 device running iOS 14.3, which is jailbroken using unc0ver 6.1.1.
I would expect the following code to spawn a new instance of <app>.
import frida, time
device = frida.get_usb_device()
device.kill("app") # Make sure no instances of "app" are running
time.sleep(3) # give the device a moment to collect its thoughts
device.spawn("com.app")
Doing this does spawn a new instance of <app> on my device in a resumed state, however the script containing this code hangs, before giving the following error:
frida.TimedOutError: unexpectedly timed out while waiting for app to launch
It appears that the script isn't able to acknowledge that <app> has launched - either Frida server is not sending a notification, or the Device object isn't receiving it.
Still bugging, but a (slightly shaky) workaround for anyone experiencing the same:
import frida
device = frida.get_usb_device()
device.kill("App")
try:
device.spawn("com.app")
except frida.TimedOutError:
pass
device.attach("App")
Killing/Spawning through frida took forever or didn't do anything, but this workaround worked instantly & every time for me:
import frida
import subprocess
app = 'com.app.name'
subprocess.run(['adb', 'shell', f'am force-stop {app} && monkey -p {app} 1'])
device = frida.get_usb_device()
session = device.attach(app)
bump