honeynet / droidbot

A lightweight test input generator for Android. Similar to Monkey, but with more intelligence and cool features!
MIT License
791 stars 229 forks source link

AttributeError: 'NoneType' object has no attribute 'policy' #107

Open hayyanHasan opened 4 years ago

hayyanHasan commented 4 years ago

Hello , Thank you for the helpful tool ... when I am trying to run it using ubuntu 16.04 as a host and android google nexus 4 and 5 with different APIs the following error comes up:

WARNING:Device:Seems like you are using an emulator. If so, please add is_emulator option. Traceback (most recent call last): File "/home/hayyan/droidbot/droidbot/droidbot.py", line 96, in init self.app = App(app_path, output_dir=self.output_dir) File "/home/hayyan/droidbot/droidbot/app.py", line 28, in init from androguard.core.bytecodes.apk import APK File "/usr/local/lib/python2.7/dist-packages/androguard/core/bytecodes/apk.py", line 9, in from androguard.core.bytecodes.axml import ARSCParser, AXMLPrinter, ARSCResTableConfig, AXMLParser, format_value, START_TAG, END_TAG, TEXT, END_DOCUMENT File "/usr/local/lib/python2.7/dist-packages/androguard/core/bytecodes/axml/init.py", line 17, in from lxml import etree ImportError: /usr/local/lib/python2.7/dist-packages/lxml/etree.so: file too short [CONNECTION] ADB is disconnected WARNING:DroidBotIme:Failed to disconnect DroidBotIME! Traceback (most recent call last): File "/usr/local/bin/droidbot", line 9, in load_entry_point('droidbot', 'console_scripts', 'droidbot')() File "/home/hayyan/droidbot/droidbot/start.py", line 168, in main replay_output=opts.replay_output) File "/home/hayyan/droidbot/droidbot/droidbot.py", line 116, in init self.stop() File "/home/hayyan/droidbot/droidbot/droidbot.py", line 191, in stop if hasattr(self.input_manager.policy, "master") and \ AttributeError: 'NoneType' object has no attribute 'policy'

Regards..

mengqianX commented 9 months ago

Hi,I have meet same problem before, and I was able to resolve it by following these steps. (maybe it could help you or someone who have face the same issue)

  1. check if your device have the minicap file. The installation can see :https://github.com/DeviceFarmer/minicap
  2. check the apk file can install successfully on the device, you can manually drag the apk file to the device to valid.