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

Argparser mix up filepath and device_serial #3

Closed
hannoL opened this issue Jul 10, 2015 · 1 comment
Closed

Argparser mix up filepath and device_serial #3

hannoL opened this issue Jul 10, 2015 · 1 comment
Assignees
Labels

Comments

@hannoL
Copy link
Collaborator

hannoL commented Jul 10, 2015

Error 4 with filepath

If I only specify a filepath with -a option, then the droidbot interpretate this as device. I think there is something wrong with the argparser.

RuntimeError: ERROR: couldn't find device that matches '/home/hanno/mobileSamples/myApkTresor/0xA1EA512A.apk' in [<com.dtmilano.android.adb.adbclient.Device instance at 0x7fa431a23ea8>]

Can you reproduce this? Or did you need any further information?

Envirement:

Output

hanno@dockerDroidBox:~/work/PycharmProjects/gsoc_droidbot$ python start.py -a ~/mobileSamples/myApkTresor/0xA1EA512A.apk
Connecting to a device with serialno=/home/hanno/mobileSamples/myApkTresor/0xA1EA512A.apk with a timeout of 60 secs...
Traceback (most recent call last):
  File "start.py", line 59, in <module>
    main()
  File "start.py", line 54, in main
    droidbot.start()
  File "/home/hanno/work/PycharmProjects/gsoc_droidbot/droidbot/droidbot.py", line 47, in start
    device = Device(self.options.device_serial)
  File "/home/hanno/work/PycharmProjects/gsoc_droidbot/droidbot/types.py", line 44, in __init__
    self.connect()
  File "/home/hanno/work/PycharmProjects/gsoc_droidbot/droidbot/types.py", line 96, in connect
    self.get_view_client()
  File "/home/hanno/work/PycharmProjects/gsoc_droidbot/droidbot/types.py", line 165, in get_view_client
    self.view_client = ViewClient(*ViewClient.connectToDeviceOrExit(**kwargs1), **kwargs2)
  File "/home/hanno/work/PycharmProjects/gsoc_droidbot/com/dtmilano/android/viewclient.py", line 2551, in connectToDeviceOrExit
    device = adbclient.AdbClient(serialno, ignoreversioncheck=ignoreversioncheck)
  File "/home/hanno/work/PycharmProjects/gsoc_droidbot/com/dtmilano/android/adb/adbclient.py", line 160, in __init__
    self.__setTransport()
  File "/home/hanno/work/PycharmProjects/gsoc_droidbot/com/dtmilano/android/adb/adbclient.py", line 306, in __setTransport
    raise RuntimeError("ERROR: couldn't find device that matches '%s' in %s" % (self.serialno, devices))
RuntimeError: ERROR: couldn't find device that matches '/home/hanno/mobileSamples/myApkTresor/0xA1EA512A.apk' in [<com.dtmilano.android.adb.adbclient.Device instance at 0x7fa431a23ea8>]
@hannoL hannoL added the bug label Jul 10, 2015
@hannoL hannoL assigned yuanchun-li and hannoL and unassigned yuanchun-li Jul 10, 2015
@hannoL
Copy link
Collaborator Author

hannoL commented Jul 13, 2015

By a little bit debugging I found, that https://github.com/lynnlyc/droidbot/blob/master/com/dtmilano/android/viewclient.py#L2539 between Line 2536 and Line 2541 set serial to an arbitrary parameters.
Working on a Workaround, but have not tested it yet.

hannoL added a commit that referenced this issue Jul 16, 2015
My workaround in 4ea87c9 has the same effect, but it does not change the external code.
@hannoL hannoL closed this as completed in 4ea87c9 Jul 17, 2015
yuanchun-li added a commit that referenced this issue Jul 17, 2015
Workaround for #3 better fix of serialno
yuanchun-li pushed a commit that referenced this issue May 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants