From 2cd59ec2b4a12676db621317ce62f963ca4e55f9 Mon Sep 17 00:00:00 2001 From: Fedor Korotkov Date: Wed, 1 May 2024 15:39:25 +0200 Subject: [PATCH] Fixed Simulator Opening (#146) --- templates/xcode.pkr.hcl | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/templates/xcode.pkr.hcl b/templates/xcode.pkr.hcl index 238961b..6d5c62c 100644 --- a/templates/xcode.pkr.hcl +++ b/templates/xcode.pkr.hcl @@ -103,6 +103,18 @@ build { ] } + // warm up Xcodes by opening all of them, waiting a minute and trying to open Simulator app + // to make things clean we'll set ApplePersistence so on restart macOS won't try to reopen all the apps + provisioner "shell" { + inline = [ + "source ~/.zprofile", + "defaults write -g ApplePersistence -bool no", + "open /Applications/Xcode*.app", + "sleep 60", + "open -a Simulator" + ] + } + provisioner "shell" { inline = [ "source ~/.zprofile", @@ -164,7 +176,7 @@ build { "source ~/.zprofile", "df -h", "export FREE_MB=$(df -m | awk '{print $4}' | head -n 2 | tail -n 1)", - "[[ $FREE_MB -gt 20000 ]] && echo OK || exit 1" + "[[ $FREE_MB -gt 15000 ]] && echo OK || exit 1" ] } }