Last active
July 16, 2024 08:37
-
-
Save yannxou/e5139d83c0fdb2f0f56289ade25b5eeb to your computer and use it in GitHub Desktop.
Xcode build phase pre-action to copy File.app content for UI testing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Ensure simulator is started before copying to grant access to folder (otherwise the target path remains read-only) | |
echo "Starting simulator (UUID=$TARGET_DEVICE_IDENTIFIER)..." | |
xcrun simctl boot $TARGET_DEVICE_IDENTIFIER; open -a Simulator | |
xcrun simctl bootstatus $TARGET_DEVICE_IDENTIFIER | |
FILES_PATH="$(xcrun simctl listapps $TARGET_DEVICE_IDENTIFIER | grep LocalStorage | awk -F'"' '{print $4}' | sed -e "s/^file:\/\///")/File Provider Storage" | |
INPUT_FOLDER="$SRCROOT/E2ETests/Resources/File Provider Storage"; | |
echo "Copying File Provider Storage files to simulator..."; | |
# Using rsync to skip copying hidden files | |
rsync -av --exclude=".*" "$INPUT_FOLDER/" "$FILES_PATH/" | |
# cp -R "$INPUT_FOLDER/" "$FILES_PATH/" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment