android-emulator-runner icon indicating copy to clipboard operation
android-emulator-runner copied to clipboard

Question - How to load apk on Android Emulator from pipeline

Open jesussalatiel opened this issue 2 years ago • 1 comments

I'd like to know how can I add the .apk on the emulator device from the pipeline, thank you!

name: Appium CI - Android on: [ push ]

jobs: Automate: runs-on: macos-latest strategy: matrix: api-level: [28] #22, 25, include: - EMULATOR_API: 28 EMULATOR_ARCH: x86_64 #- EMULATOR_API: 25 # EMULATOR_ARCH: x86 #- EMULATOR_API: 22 # EMULATOR_ARCH: x86 steps: - uses: actions/checkout@v2 - name: Set up JDK 1.8 uses: actions/setup-java@v1 with: java-version: 1.8

  - uses: actions/setup-node@v2
    with:
      node-version: '12'
  - run: |
      npm install -g [email protected]
      appium -v
      appium &>/dev/null &
  - name: Execute emulator tests
    timeout-minutes: 30
    uses: reactivecircus/[email protected]
    with:
      api-level: ${{ matrix.api-level }}
      arch: ${{ matrix.EMULATOR_ARCH }}
      disable-animations: true
      profile: Nexus 6
      emulator-options: -no-snapshot -no-window -no-boot-anim -camera-back none -camera-front none -gpu swiftshader_indirect
      script: mvn package

jesussalatiel avatar Aug 08 '22 18:08 jesussalatiel

- uses: actions/setup-node@v2
    with:
      node-version: '12'
  - run: |
      npm install -g [email protected]
      appium -v
      appium &>/dev/null &
  - name: Execute emulator tests
    timeout-minutes: 30
    uses: reactivecircus/[email protected]
    with:
      api-level: ${{ matrix.api-level }}
      arch: ${{ matrix.EMULATOR_ARCH }}
      disable-animations: true
      profile: Nexus 6
      emulator-options: -no-snapshot -no-window -no-boot-anim -camera-back none -camera-front none -gpu swiftshader_indirect
      script: adb install <package-location> && mvn package

zastress avatar Aug 26 '22 07:08 zastress

Yes, to clarify:

  1. Generate api from previous job or separate workflow.
  2. Archive and Upload the APK
  3. Download APK using an action
  4. adb install the APK from location you downloaded it
  5. run tests in script portion after installation

Can use script: | and pipe it all below in the emulator action.

mrk-han avatar Oct 19 '22 20:10 mrk-han