-
Notifications
You must be signed in to change notification settings - Fork 946
Description
Describe the bug
Objection cannot find devices even adb is there. I am trying to run objection on NOX player.
To Reproduce
objection -n appname start
Expected behavior
No error
Evidence / Logs / Screenshots
File "C:\Users\user\AppData\Local\Programs\Python\Python312\Lib\site-packages\objection\utils\agent.py", line 186, in set_device
raise Exception('Unable to find a device')
Exception: Unable to find a device
FIX
the fix is not eligant but it works. maybe the owner can find a more elegant solution.
in agent.py
import time
//line 170-180
elif self.config.device_type is not None:
tmp = frida.enumerate_devices() // to initiate frida (this one doesnt include the usb device)
time.sleep(1) // let frida run for a bit so that it include the usb device
for dev in frida.enumerate_devices(): // use the frida again so that this time it include the usb device
if dev.type == self.config.device_type:
self.device = dev //sucessfully set the device