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

adb: device 'emulator-5554' not found #404

Open
alirezaeiii opened this issue Aug 17, 2024 · 6 comments
Open

adb: device 'emulator-5554' not found #404

alirezaeiii opened this issue Aug 17, 2024 · 6 comments

Comments

@alirezaeiii
Copy link

alirezaeiii commented Aug 17, 2024

Here is my scrip to start the emulator :

name: Android Instrumentation Test
on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main

jobs:
  android_test:
     name: Running Android Tests
     runs-on: macos-13
     continue-on-error: true
     steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Set up JDK 17
        uses: actions/setup-java@v4
        with:
          java-version: 17
          distribution: 'adopt'

      - name: Change wrapper permissions
        run: chmod +x ./gradlew

      - name: Setup Android SDK
        uses: android-actions/setup-android@v3

      - name: Start Android Emulator
        uses: reactivecircus/android-emulator-runner@v2
        with:
           api-level: 33
           target: default
           arch: x86_64
           profile: Nexus 4
           emulator-options: -no-window -no-boot-anim -no-audio -no-snapshot-load
           script: |
            adb wait-for-device
            adb shell input keyevent 82
           ./gradlew connectedAndroidTest --continue

      - name: Upload Test Reports
        if: failure()
        uses: actions/upload-artifact@v4
        with:
          name: android-test-report
          path: '**/build/reports/androidTests/connected/'

It seems device is booted successfully.
When it want to run test, it prints :

Execution failed for task ':features:feature-setting:connectedDebugAndroidTest'.
> com.android.builder.testing.api.DeviceException: No connected devices!

I am runnung on macOS 13, so why this happens? Is it something wrong in my script for Github Action?

Here is the sample : https://github.com/alirezaeiii/TMDb-Compose-Playground

@poponuts
Copy link

poponuts commented Aug 21, 2024

I had a similar issue. Can someone have a look at this?

The process '/usr/local/lib/android/sdk/platform-tools/adb' failed with exit code 1
  /usr/local/lib/android/sdk/platform-tools/adb -s emulator-5554 shell getprop sys.boot_completed
  adb: device 'emulator-5554' not found

@alirezaeiii
Copy link
Author

@eXpl0it3r
Copy link

eXpl0it3r commented Oct 2, 2024

We're running into this issue as well: https://github.com/SFML/SFML/actions/runs/11134310092/job/30953377901#step:25:76

Lowering the emu API level to 26 doesn't seem to work and even if it did, seems more like a workaround than a fix. Maybe the issue should be reopened: https://github.com/SFML/SFML/actions/runs/11151778634/job/30995995208

Maybe GitHub changed something on the image, which trips up the emulator from starting...

@alirezaeiii
Copy link
Author

alirezaeiii commented Oct 3, 2024

I agree @eXpl0it3r , It is just a workaround not a fix. I reopen the issue.

@alirezaeiii alirezaeiii reopened this Oct 3, 2024
@zhkvdm
Copy link

zhkvdm commented Oct 7, 2024

Any updates? I have the same issue. With 26 image it works well. After update to 29 image android tests fails.
Emulator is connected

adb devices -l
List of devices attached
emulator-5554          device product:sdk_gphone_x86 model:Android_SDK_built_for_x86 device:generic_x86 transport_id:1

But tests failed

> Task connectedDebugAndroidTest FAILED
adb: device 'emulator-5554' not found
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task 'connectedDebugAndroidTest'.
> com.android.builder.testing.api.DeviceException: No connected devices!

And also command adb shell settings fails. Try to call it after adb devices

adb shell settings list global
adb: device 'emulator-5554' not found

@ychescale9
Copy link
Member

I was able to run it successfully with API 31 on macos https://github.com/ReactiveCircus/android-emulator-runner/actions/runs/11202425213/job/31138520013 though it's much slower than the Linux runners.

Unless your job strictly requires running on macOS, I suggest using the linux runners and enable KVM if you can.

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

5 participants