Skip to content

Commit

Permalink
Do not allow clearing Android logs if the emulator is not running (#2…
Browse files Browse the repository at this point in the history
…1578)

### Description
Do not allow clearing Android logs if the emulator is not running



### Motivation and Context
Previously the Clearing Android logs step stuck until the pipeline
timeout. If one of the previous steps failed.
  • Loading branch information
jchen351 authored Aug 22, 2024
1 parent ff3e8b0 commit 6c1a3f8
Showing 1 changed file with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,23 @@ parameters:
type: stepList

steps:
- task: CmdLine@2
input:
script: |
if [ -f $(Build.BinariesDirectory)/emulator.pid ]; then
echo "Emulator is running."
echo "##vso[task.setvariable variable=isEmulatorRunning]True"
else
echo "Emulator is not running."
fi
name: Determine if emulator is running

- task: CmdLine@2
inputs:
script: |
python3 tools/python/run_adb.py logcat --clear
displayName: "Clear Android logs"
condition: succeededOrFailed()
condition: eq(variables['isEmulatorRunning'], 'True')

- ${{ parameters.steps }}

Expand All @@ -19,4 +30,4 @@ steps:
script: |
python3 tools/python/run_adb.py logcat -d
displayName: "Dump Android logs"
condition: succeededOrFailed()
condition: eq(variables['isEmulatorRunning'], 'True')

0 comments on commit 6c1a3f8

Please sign in to comment.