Skip to content

Retry adb also on Mac #46

Closed
Closed

Description

@besendorf

On Windows AndroidQF retries to get an adb connection every 5 seconds but on MacOS androidqf exits if it can't get an adb connection
impossible adb
part 1

Activity

  1. added
    bug
    on Sep 11, 2024
  2. besendorf commented on Sep 18, 2024

    @besendorf
    CollaboratorAuthor

    Screenshot with verbose mode
    image

  3. DonnchaC commented on Feb 4, 2025

    @DonnchaC
    Contributor

    I wonder if the MacOS ADB binary sends a syscall to kill the process when it fails to find a device.

  4. DonnchaC commented on Feb 4, 2025

    @DonnchaC
    Contributor

    Hmm. I'm confused now.

    In main.go we call adb.New(serial).

    //https://github.com/mvt-project/androidqf/blob/main/main.go#L84C1-L88C3
    	log.Debug("Starting androidqf")
    	adb.Client, err = adb.New(serial)
    	if err != nil {
    		log.Fatal("Impossible to initialize adb: ", err)
    	}
    

    The error "no devices connected to adb" is being returned as no devices are found.

    	if len(devices) == 0 {
    		return nil, fmt.Errorf("no devices connected to adb")
    	}
    

    There is no loop around the adb.New() code so it is expected that AndroidQF dies. The loop should only run in the case where a device is detected but is not trusted yet.

    The bug actually is why adb.New() appears to pass sometimes and start looping even when no device is connected??

  5. DonnchaC commented on Feb 7, 2025

    @DonnchaC
    Contributor

    Should be fixed in #55

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions