Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not detect device on first execution, but does on second #62

Open
zymos opened this issue Nov 3, 2014 · 2 comments
Open

Does not detect device on first execution, but does on second #62

zymos opened this issue Nov 3, 2014 · 2 comments

Comments

@zymos
Copy link

zymos commented Nov 3, 2014

Ok, so I run aafm with my phone plugged in, and it gives 'error: device not found'. Then i run aafm again a second later, and it works.

Its probably a simple fix by adding a second scan with a delay on startup.

here is the output

First run

EXECUTE ('adb', 'devices')
EXECUTE ('adb', '-s', '', 'shell', 'cat', '/system/build.prop')
error: device not found
EXECUTE ('adb', '-s', '
', 'shell', 'cat', '/system/build.prop')
error: device not found
EXECUTE ('adb', '-s', '6a7165c6', 'shell', 'cat', '/system/build.prop')
EXECUTE ('adb', '-s', '*', 'shell', 'ls', '--help')
error: device not found
EXECUTE ('adb', 'devices')
EXECUTE ('adb', '-s', '6a7165c6', 'shell', 'cat', '/system/build.prop')
EXECUTE ('adb', '-s', '6a7165c6', 'shell', 'ls', '--help')
Traceback (most recent call last):
File "/opt/aafm/src/aafm-gui.py", line 883, in
gui = Aafm_GUI()
File "/opt/aafm/src/aafm-gui.py", line 81, in init
self.refresh_menu_devices()
File "/opt/aafm/src/aafm-gui.py", line 177, in refresh_menu_devices
self.refresh_device_files()
File "/opt/aafm/src/aafm-gui.py", line 246, in refresh_device_files
self.device_treeViewFile.load_data(self.dir_scan_device(self.aafm.device_cwd))
AttributeError: Aafm_GUI instance has no attribute 'device_treeViewFile'

Second run

EXECUTE ('adb', 'devices')
EXECUTE ('adb', '-s', '6a7165c6', 'shell', 'cat', '/system/build.prop')
EXECUTE ('adb', '-s', '6a7165c6', 'shell', 'ls', '--help')
EXECUTE ('adb', 'devices')
EXECUTE ('adb', '-s', '6a7165c6', 'shell', 'cat', '/system/build.prop')
EXECUTE ('adb', '-s', '6a7165c6', 'shell', 'ls', '-l', '-a', '/mnt/external_sd/Audiobooks/')
EXECUTE ('adb', '-s', '6a7165c6', 'shell', 'df', '/mnt/external_sd/Audiobooks')

Thanks for an awesome prog

@sole
Copy link
Owner

sole commented Jan 5, 2016

Does this always happen? (sorry for the long delay - I just don't have the bandwidth to attend to all projects)

It might just be that the adb server is not started on the first go... hmmm, yeah maybe your suggestion could work (I think the server starts when adb is called). I have no time to implement it, though. If anyone wants to have a go, feel free.

@cb474
Copy link

cb474 commented Jan 6, 2016

I have had exactly this problem for many months now. The first time I try to run aafm it failes to execute. The second time it works. It always happens. I get similar messages.

1st run:

EXECUTE ('adb', 'devices')
EXECUTE ('adb', '-s', '*', 'shell', 'cat', '/system/build.prop')
error: device not found
EXECUTE ('adb', '-s', '*', 'shell', 'cat', '/system/build.prop')
error: device not found
EXECUTE ('adb', '-s', '0032569052087e14', 'shell', 'cat', '/system/build.prop')
EXECUTE ('adb', '-s', '*', 'shell', 'ls', '--help')
error: device not found
EXECUTE ('adb', 'devices')
EXECUTE ('adb', '-s', '0032569052087e14', 'shell', 'cat', '/system/build.prop')
EXECUTE ('adb', '-s', '0032569052087e14', 'shell', 'ls', '--help')
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/aafm/aafm-gui.py", line 880, in <module>
    gui = Aafm_GUI()
  File "/usr/lib/python2.7/site-packages/aafm/aafm-gui.py", line 78, in __init__
    self.refresh_menu_devices()
  File "/usr/lib/python2.7/site-packages/aafm/aafm-gui.py", line 174, in refresh_menu_devices
    self.refresh_device_files()
  File "/usr/lib/python2.7/site-packages/aafm/aafm-gui.py", line 243, in refresh_device_files
    self.device_treeViewFile.load_data(self.dir_scan_device(self.aafm.device_cwd))
AttributeError: Aafm_GUI instance has no attribute 'device_treeViewFile'

Second run:

EXECUTE ('adb', 'devices')
EXECUTE ('adb', '-s', '0032569052087e14', 'shell', 'cat', '/system/build.prop')
EXECUTE ('adb', '-s', '0032569052087e14', 'shell', 'ls', '--help')
EXECUTE ('adb', 'devices')
EXECUTE ('adb', '-s', '0032569052087e14', 'shell', 'cat', '/system/build.prop')
EXECUTE ('adb', '-s', '0064596052180e13', 'shell', 'ls', '-l', '-a', '/mnt/sdcard/')
EXECUTE ('adb', '-s', '0064596052180e13', 'shell', 'df', '/mnt/sdcard/')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants