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

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

Merged
merged 10 commits into from
Aug 22, 2024
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')
Loading