Skip to content

Commit

Permalink
build(iOS): improve XCUITest build, remove unnecessary files.
Browse files Browse the repository at this point in the history
  • Loading branch information
asafkorem committed Aug 25, 2024
1 parent f6ed49e commit 03824f6
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion detox/scripts/build_xcuitest.ios.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,20 @@ mkdir -p "${XCUITEST_OUTPUT_DIR}"

# Build Simulator version

env -i bash -c "xcodebuild -project \"${XCODEPROJ}\" -scheme \"${PROJECT_NAME}\" -UseNewBuildSystem=\"YES\" -configuration \"${CONFIGURATION}\" -sdk iphonesimulator -destination 'generic/platform=iOS Simulator' -derivedDataPath \"${XCUITEST_OUTPUT_DIR}\" build-for-testing -quiet"
XCUITEST_OUTPUT_DIR_TEMP = "${XCUITEST_OUTPUT_DIR}/Temp"

mkdir -p "${XCUITEST_OUTPUT_DIR_TEMP}"

env -i bash -c "xcodebuild -project \"${XCODEPROJ}\" -scheme \"${PROJECT_NAME}\" -UseNewBuildSystem=\"YES\" -configuration \"${CONFIGURATION}\" -sdk iphonesimulator -destination 'generic/platform=iOS Simulator' -derivedDataPath \"${XCUITEST_OUTPUT_DIR_TEMP}\" build-for-testing -quiet"

# Find the .xctestrun file inside the output directory, copy it, and remove the rest

XCTESTRUN_FILE=$(find "${XCUITEST_OUTPUT_DIR_TEMP}" -name "*.xctestrun")

# Copy the .xctestrun file to the output directory

cp "${XCTESTRUN_FILE}" "${XCUITEST_OUTPUT_DIR}/Detox.xctestrun"

# Remove the temp directory

rm -fr "${XCUITEST_OUTPUT_DIR_TEMP}"

0 comments on commit 03824f6

Please sign in to comment.