diff --git a/.drone.jsonnet b/.drone.jsonnet index a073e5757..fef2077d1 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -108,7 +108,26 @@ local pre_boot_test_sim = { local clean_up_test_simulator = { name: 'Clean Up Test Simulator', commands: [ - './Scripts/clean-up-test-simulator.sh $(<./build/artifacts/sim_uuid)' + ||| + function handle_exit() { + xcrun simctl delete unavailable + + if [ -e build/artifacts/sim_uuid ]; then + xcrun simctl delete $(<./build/artifacts/sim_uuid) + echo -e "\n\n\n\n\e[32mSimulator $(<./build/artifacts/sim_uuid) deleted.\e[0m\n\n\n" + else + echo -e "\n\n\n\n\e[31mSimulator not deleted.\e[0m\n\n\n" + fi + exit 0 + } + + trap handle_exit EXIT + + while true; do + sleep 10 + done + ||| +// './Scripts/clean-up-test-simulator.sh $(<./build/artifacts/sim_uuid)' ], depends_on: [ 'Pre-Boot Test Simulator', diff --git a/Scripts/clean-up-test-simulator.sh b/Scripts/clean-up-test-simulator.sh index 6c5a4f548..c780467e4 100755 --- a/Scripts/clean-up-test-simulator.sh +++ b/Scripts/clean-up-test-simulator.sh @@ -12,6 +12,7 @@ SIM_UUID="$1" function handle_exit() { xcrun simctl delete unavailable xcrun simctl delete ${SIM_UUID} + echo -e "\n\n\n\n\e[32mSimulator ${SIM_UUID} deleted.\e[0m\n\n\n" exit 0 }