sensepost / sensepost/objection
[bug] Device not detected
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 9.4k
- Forks
- 1k
- Avg merge
- 14d 5h
- Merged PRs (30d)
- 1
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in agent.py around lines 170-180, where set_device raises “Unable to find a device” after objection -n appname start. Reproduce with a NOX player and confirm how frida.enumerate_devices() behaves before and after the proposed delay. Done means objection detects the device without raising the exception.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100