Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DeviceKit/View/BroadcastStarterView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import SwiftUI

struct BroadcastStarterView: View {
let preferredExtension =
"com.mobilenext.devicekit-ios.BroadcastUploadExtension"
"com.mobilenext.devicekit.BroadcastUploadExtension"

var body: some View {
BroadcastPickerView(preferredExtension: preferredExtension)
Expand Down
19 changes: 10 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Project configuration
PROJECT = devicekit-ios.xcodeproj
SCHEME = devicekit-ios
TEST_TARGET = devicekit-ios-uitests
BUILD_DIR = build
ARCHIVE_PATH = $(BUILD_DIR)/$(SCHEME).xcarchive
EXPORT_PATH = $(BUILD_DIR)/export
Expand Down Expand Up @@ -45,7 +46,7 @@ ipa-unsigned:
@rm -rf $(EXPORT_PATH)/Payload
@rm -f $(EXPORT_PATH)/$(SCHEME)-runner.ipa
@mkdir -p $(EXPORT_PATH)/Payload
@cp -r "$(BUILD_DIR)/Build/Products/$(CONFIGURATION)-iphoneos/$(SCHEME)UITests-Runner.app" $(EXPORT_PATH)/Payload/
@cp -r "$(BUILD_DIR)/Build/Products/$(CONFIGURATION)-iphoneos/$(TEST_TARGET)-Runner.app" $(EXPORT_PATH)/Payload/
@cd $(EXPORT_PATH) && zip -r $(SCHEME)-runner.ipa Payload
@rm -rf $(EXPORT_PATH)/Payload
@echo "Runner IPA created at: $(EXPORT_PATH)/$(SCHEME)-runner.ipa"
Expand All @@ -64,10 +65,10 @@ sim-zip-arm64:
CODE_SIGNING_ALLOWED=NO \
ARCHS=arm64 | xcbeautify
@mkdir -p $(EXPORT_PATH)
@cp -r "$(BUILD_DIR)/Build/Products/$(CONFIGURATION)-iphonesimulator/$(SCHEME)UITests-Runner.app" $(EXPORT_PATH)/
@cp -r "$(BUILD_DIR)/Build/Products/$(CONFIGURATION)-iphonesimulator/$(TEST_TARGET)-Runner.app" $(EXPORT_PATH)/
@scripts/patch-runner.sh "$(BUILD_DIR)/Build/Products/$(CONFIGURATION)-iphonesimulator" "$(EXPORT_PATH)"
@cd $(EXPORT_PATH) && zip -r $(SCHEME)-Sim-arm64.zip $(SCHEME)UITests-Runner.app
@rm -rf "$(EXPORT_PATH)/$(SCHEME)UITests-Runner.app"
@cd $(EXPORT_PATH) && zip -r $(SCHEME)-Sim-arm64.zip $(TEST_TARGET)-Runner.app
@rm -rf "$(EXPORT_PATH)/$(TEST_TARGET)-Runner.app"
@echo "Simulator zip created at: $(EXPORT_PATH)/$(SCHEME)-Sim-arm64.zip"

# Build XCUITest runner for iOS Simulator (x86_64 — Intel)
Expand All @@ -84,10 +85,10 @@ sim-zip-x86_64:
CODE_SIGNING_ALLOWED=NO \
ARCHS=x86_64 | xcbeautify
@mkdir -p $(EXPORT_PATH)
@cp -r "$(BUILD_DIR)/Build/Products/$(CONFIGURATION)-iphonesimulator/$(SCHEME)UITests-Runner.app" $(EXPORT_PATH)/
@cp -r "$(BUILD_DIR)/Build/Products/$(CONFIGURATION)-iphonesimulator/$(TEST_TARGET)-Runner.app" $(EXPORT_PATH)/
@scripts/patch-runner.sh "$(BUILD_DIR)/Build/Products/$(CONFIGURATION)-iphonesimulator" "$(EXPORT_PATH)"
@cd $(EXPORT_PATH) && zip -r $(SCHEME)-Sim-x86_64.zip $(SCHEME)UITests-Runner.app
@rm -rf "$(EXPORT_PATH)/$(SCHEME)UITests-Runner.app"
@cd $(EXPORT_PATH) && zip -r $(SCHEME)-Sim-x86_64.zip $(TEST_TARGET)-Runner.app
@rm -rf "$(EXPORT_PATH)/$(TEST_TARGET)-Runner.app"
@echo "Simulator zip created at: $(EXPORT_PATH)/$(SCHEME)-Sim-x86_64.zip"

# Build both simulator zips
Expand All @@ -106,7 +107,7 @@ sim-install:
PRODUCTS="$(BUILD_DIR)/local/Build/Products/$(CONFIGURATION)-iphonesimulator"; \
scripts/patch-runner.sh "$$PRODUCTS"; \
xcrun simctl install "$$BOOTED" "$$PRODUCTS/$(SCHEME).app"; \
xcrun simctl install "$$BOOTED" "$$PRODUCTS/$(SCHEME)UITests-Runner.app"; \
xcrun simctl install "$$BOOTED" "$$PRODUCTS/$(TEST_TARGET)-Runner.app"; \
echo "Installed on simulator $$BOOTED"

# Build, run mocha tests with code coverage
Expand All @@ -118,7 +119,7 @@ test-coverage:
# Generate HTML coverage report (run after test-coverage)
coverage-html:
@PROFDATA=$$(find $(BUILD_DIR)/local/Build/ProfileData -name "Coverage.profdata" 2>/dev/null | head -1); \
BINARY="$(BUILD_DIR)/local/Build/Products/Debug-iphonesimulator/$(SCHEME)UITests-Runner.app/PlugIns/$(SCHEME)UITests.xctest/$(SCHEME)UITests"; \
BINARY="$(BUILD_DIR)/local/Build/Products/Debug-iphonesimulator/$(TEST_TARGET)-Runner.app/PlugIns/$(TEST_TARGET).xctest/$(TEST_TARGET)"; \
if [ -z "$$PROFDATA" ] || [ ! -f "$$BINARY" ]; then echo "error: Run 'make test-coverage' first"; exit 1; fi; \
rm -rf coverage-html; \
xcrun llvm-cov show "$$BINARY" -instr-profile "$$PROFDATA" -format=html -output-dir=coverage-html \
Expand Down
44 changes: 22 additions & 22 deletions devicekit-ios.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@

/* Begin PBXFileReference section */
52049BD32935039F00807AA3 /* devicekit-ios.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "devicekit-ios.app"; sourceTree = BUILT_PRODUCTS_DIR; };
52049BF3293503A200807AA3 /* devicekit-iosUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "devicekit-iosUITests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
52049BF3293503A200807AA3 /* devicekit-ios-uitests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "devicekit-ios-uitests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
52049BF7293503A200807AA3 /* devicekit_iosUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = devicekit_iosUITests.swift; sourceTree = "<group>"; };
521C1F022D8014340024EE42 /* AXClientProxy.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AXClientProxy.h; sourceTree = "<group>"; };
521C1F042D8016950024EE42 /* XCAccessibilityElement.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XCAccessibilityElement.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -244,7 +244,7 @@
isa = PBXGroup;
children = (
52049BD32935039F00807AA3 /* devicekit-ios.app */,
52049BF3293503A200807AA3 /* devicekit-iosUITests.xctest */,
52049BF3293503A200807AA3 /* devicekit-ios-uitests.xctest */,
78F689062F17EE190025C8AC /* BroadcastUploadExtension.appex */,
);
name = Products;
Expand Down Expand Up @@ -453,9 +453,9 @@
productReference = 52049BD32935039F00807AA3 /* devicekit-ios.app */;
productType = "com.apple.product-type.application";
};
52049BF2293503A200807AA3 /* devicekit-iosUITests */ = {
52049BF2293503A200807AA3 /* devicekit-ios-uitests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 52049C03293503A200807AA3 /* Build configuration list for PBXNativeTarget "devicekit-iosUITests" */;
buildConfigurationList = 52049C03293503A200807AA3 /* Build configuration list for PBXNativeTarget "devicekit-ios-uitests" */;
buildPhases = (
52D8FA9E2D6DD0970015FAB3 /* Headers */,
52049BEF293503A200807AA3 /* Sources */,
Expand All @@ -470,13 +470,13 @@
fileSystemSynchronizedGroups = (
78C54BD12F2D67E300A9369C /* Streamer */,
);
name = "devicekit-iosUITests";
name = "devicekit-ios-uitests";
packageProductDependencies = (
5279BFD52935ECE20056C609 /* FlyingFox */,
78C54B342F2CF23800A9369C /* H264Codec */,
);
productName = "maestro-driver-iosUITests";
productReference = 52049BF3293503A200807AA3 /* devicekit-iosUITests.xctest */;
productReference = 52049BF3293503A200807AA3 /* devicekit-ios-uitests.xctest */;
productType = "com.apple.product-type.bundle.ui-testing";
};
78F689052F17EE190025C8AC /* BroadcastUploadExtension */ = {
Expand Down Expand Up @@ -545,7 +545,7 @@
projectRoot = "";
targets = (
52049BD22935039F00807AA3 /* devicekit-ios */,
52049BF2293503A200807AA3 /* devicekit-iosUITests */,
52049BF2293503A200807AA3 /* devicekit-ios-uitests */,
78F689052F17EE190025C8AC /* BroadcastUploadExtension */,
);
};
Expand Down Expand Up @@ -780,9 +780,9 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = UWTTLVVSRY;
DEVELOPMENT_TEAM = "";
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = "";
INFOPLIST_KEY_CFBundleDisplayName = "Screen Stream";
Expand All @@ -797,7 +797,7 @@
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.mobilenext.devicekit-ios";
PRODUCT_BUNDLE_IDENTIFIER = com.mobilenext.devicekit;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Bundle identifiers defined in the Xcode project:"
rg -n 'PRODUCT_BUNDLE_IDENTIFIER = ' devicekit-ios.xcodeproj/project.pbxproj

echo
echo "Places where both the host app and runner app are installed or packaged together:"
rg -n '\$\(SCHEME\)\.app|\$\(TEST_TARGET\)-Runner\.app' Makefile

Repository: mobile-next/devicekit-ios

Length of output: 1538


🏁 Script executed:

fd -t f 'BroadcastStarterView.swift' --exec cat -n {} \;

Repository: mobile-next/devicekit-ios

Length of output: 1635


Keep the UI test runner bundle identifier distinct from the app, and update the hardcoded broadcast extension identifier.

The app target and the UI test target both resolve to com.mobilenext.devicekit (lines 800/858). Since both are installed together via xcrun simctl install (Makefile:110), they will contend for the same bundle identifier. The UI test target needs its own unique identifier, e.g., with a .uitests suffix.

Additionally, BroadcastStarterView.swift:6 hardcodes com.mobilenext.devicekit-ios.BroadcastUploadExtension, but the project now defines the broadcast extension as com.mobilenext.devicekit.BroadcastUploadExtension (lines 940, 991). This mismatch will cause the broadcast picker to fail at runtime.

PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_EMIT_LOC_STRINGS = YES;
Expand All @@ -812,9 +812,9 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = UWTTLVVSRY;
DEVELOPMENT_TEAM = "";
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = "";
INFOPLIST_KEY_CFBundleDisplayName = "Screen Stream";
Expand All @@ -829,7 +829,7 @@
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.mobilenext.devicekit-ios";
PRODUCT_BUNDLE_IDENTIFIER = com.mobilenext.devicekit;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_EMIT_LOC_STRINGS = YES;
Expand All @@ -855,7 +855,7 @@
"@loader_path/Frameworks",
);
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.mobilenext.devicekit-iosUITests";
PRODUCT_BUNDLE_IDENTIFIER = com.mobilenext.devicekit;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -887,7 +887,7 @@
"@loader_path/Frameworks",
);
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.mobilenext.devicekit-iosUITests";
PRODUCT_BUNDLE_IDENTIFIER = com.mobilenext.devicekit;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -907,9 +907,9 @@
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = UWTTLVVSRY;
DEVELOPMENT_TEAM = "";
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu17;
GENERATE_INFOPLIST_FILE = YES;
Expand Down Expand Up @@ -937,7 +937,7 @@
"-DOPUS_BUILD",
"-DVAR_ARRAYS",
);
PRODUCT_BUNDLE_IDENTIFIER = "com.mobilenext.devicekit-ios.BroadcastUploadExtension";
PRODUCT_BUNDLE_IDENTIFIER = com.mobilenext.devicekit.BroadcastUploadExtension;
Comment thread
coderabbitai[bot] marked this conversation as resolved.
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SKIP_INSTALL = YES;
Expand All @@ -958,9 +958,9 @@
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = UWTTLVVSRY;
DEVELOPMENT_TEAM = "";
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu17;
GENERATE_INFOPLIST_FILE = YES;
Expand Down Expand Up @@ -988,7 +988,7 @@
"-DOPUS_BUILD",
"-DVAR_ARRAYS",
);
PRODUCT_BUNDLE_IDENTIFIER = "com.mobilenext.devicekit-ios.BroadcastUploadExtension";
PRODUCT_BUNDLE_IDENTIFIER = com.mobilenext.devicekit.BroadcastUploadExtension;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SKIP_INSTALL = YES;
Expand Down Expand Up @@ -1023,7 +1023,7 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
52049C03293503A200807AA3 /* Build configuration list for PBXNativeTarget "devicekit-iosUITests" */ = {
52049C03293503A200807AA3 /* Build configuration list for PBXNativeTarget "devicekit-ios-uitests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
52049C04293503A200807AA3 /* Debug */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "52049BF2293503A200807AA3"
BuildableName = "devicekit-iosUITests.xctest"
BlueprintName = "devicekit-iosUITests"
BuildableName = "devicekit-ios-uitests.xctest"
BlueprintName = "devicekit-ios-uitests"
ReferencedContainer = "container:devicekit-ios.xcodeproj">
</BuildableReference>
<SkippedTests>
Expand Down
2 changes: 1 addition & 1 deletion scripts/patch-runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
BUILD_DIR="${1:?Usage: $0 <build-products-dir> [runner-dir]}"
RUNNER_DIR="${2:-$BUILD_DIR}"

RUNNER_APP="${RUNNER_DIR}/devicekit-iosUITests-Runner.app"
RUNNER_APP="${RUNNER_DIR}/devicekit-ios-uitests-Runner.app"
HOST_APP="${BUILD_DIR}/devicekit-ios.app"

if [ ! -d "${RUNNER_APP}" ] || [ ! -f "${RUNNER_APP}/Info.plist" ]; then
Expand Down
Loading