Skip to content

Commit 3bb3423

Browse files
committed
Updates
1 parent 92d0823 commit 3bb3423

File tree

10 files changed

+108
-24
lines changed

10 files changed

+108
-24
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ xcuserdata
44
xcshareddata
55
RuntimeViewerUsingAppKit/RuntimeViewerCatalystHelper.app/RuntimeViewerCatalystHelper.app
66
RuntimeViewerUsingAppKit/RuntimeViewerCatalystHelper.app
7+
archive
8+
build

ArchiveScript.sh

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
#工程绝对路径
2+
project_path=$(cd `dirname $0`; pwd)
3+
4+
#工程名 将XXX替换成自己的工程名
5+
project_name="RuntimeViewer"
6+
7+
#scheme名 将XXX替换成自己的sheme名
8+
scheme_name="RuntimeViewerUsingAppKit"
9+
10+
#打包模式 Debug/Release
11+
development_mode="Release"
12+
13+
#build文件夹路径
14+
build_path=${project_path}/build
15+
16+
#plist文件所在路径
17+
exportOptionsPlistPath=${project_path}/exportTest.plist
18+
19+
#导出App文件所在路径
20+
exportAppPath=${project_path}/archive
21+
22+
23+
echo '///-----------'
24+
echo '/// 正在编译工程:'${development_mode}
25+
echo '///-----------'
26+
xcodebuild \
27+
archive -workspace ${project_path}/${project_name}.xcworkspace \
28+
-scheme ${scheme_name} \
29+
-destination 'platform=macOS,arch=arm64e' \
30+
-destination 'platform=macOS,arch=x86_64' \
31+
-configuration ${development_mode} \
32+
-skipPackagePluginValidation -skipMacroValidation \
33+
-archivePath ${build_path}/${project_name}.xcarchive -quiet || exit
34+
35+
echo '///--------'
36+
echo '/// 编译完成'
37+
echo '///--------'
38+
echo ''
39+
40+
echo '///----------'
41+
echo '/// 开始打包App'
42+
echo '///----------'
43+
44+
exportFolderName="${project_name}_$(date +"%Y-%m-%d_%H-%M-%S")"
45+
exportFullPath="${exportAppPath}/${exportFolderName}"
46+
mkdir -p "$exportFullPath"
47+
48+
xcodebuild -exportArchive -archivePath ${build_path}/${project_name}.xcarchive \
49+
-configuration ${development_mode} \
50+
-exportPath ${exportFullPath} \
51+
-exportOptionsPlist ${exportOptionsPlistPath} \
52+
-quiet || exit
53+
54+
if [ -e $exportFullPath/$project_name.app ]; then
55+
echo '///----------'
56+
echo '/// App已导出'
57+
echo '///----------'
58+
open $exportFullPath
59+
else
60+
echo '///-------------'
61+
echo '/// App导出失败 '
62+
echo '///-------------'
63+
fi
64+
echo '///------------'
65+
echo '/// App打包完成 '
66+
echo '///-----------='
67+
echo ''
68+
69+
exit 0
70+
71+

RuntimeViewerUsingAppKit/RuntimeViewerUsingAppKit.xcodeproj/project.pbxproj

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,10 @@
162162
E94E36C52CF84AF8006101C8 /* AttachToProcessViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AttachToProcessViewController.swift; sourceTree = "<group>"; };
163163
E94E36C82CF87BD6006101C8 /* RuntimeViewerSymbols.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RuntimeViewerSymbols.swift; sourceTree = "<group>"; };
164164
E9530A3B2D9D5898008FBC7F /* SIPChecker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SIPChecker.swift; sourceTree = "<group>"; };
165+
E95CDA652DAA6FA300D97B03 /* Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = "<group>"; };
166+
E95CDA662DAA6FA900D97B03 /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = "<group>"; };
167+
E95CDA672DAA970300D97B03 /* Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = "<group>"; };
168+
E95CDA682DAA970900D97B03 /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = "<group>"; };
165169
E9668FFB2CEF7140007B344A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
166170
E9668FFC2CEF7140007B344A /* launchd.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = launchd.plist; sourceTree = "<group>"; };
167171
E97544982C42BA5B00CC9DDD /* LoadFrameworksViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoadFrameworksViewController.swift; sourceTree = "<group>"; };
@@ -297,6 +301,8 @@
297301
E9432FE72C0D614A00362862 /* Assets.xcassets */,
298302
E9432FE92C0D614A00362862 /* MainMenu.xib */,
299303
E9432FEC2C0D614A00362862 /* RuntimeViewerUsingAppKit.entitlements */,
304+
E95CDA672DAA970300D97B03 /* Debug.xcconfig */,
305+
E95CDA682DAA970900D97B03 /* Release.xcconfig */,
300306
);
301307
path = RuntimeViewerUsingAppKit;
302308
sourceTree = "<group>";
@@ -450,6 +456,8 @@
450456
children = (
451457
E9E900EA2C2D0D5B00FADDCC /* main.swift */,
452458
E9C9E9C92C2D0E3C00C4AA34 /* Config.xcconfig */,
459+
E95CDA652DAA6FA300D97B03 /* Debug.xcconfig */,
460+
E95CDA662DAA6FA900D97B03 /* Release.xcconfig */,
453461
E9668FFB2CEF7140007B344A /* Info.plist */,
454462
E9668FFC2CEF7140007B344A /* launchd.plist */,
455463
);
@@ -490,7 +498,6 @@
490498
E9F6CD052D9A7B1700DBFB50 /* Embed LaunchDaemon */,
491499
E9C9E9CC2C2D0F1B00C4AA34 /* Embed LaunchServices */,
492500
E9C9E9EB2C2D33F500C4AA34 /* Embed Helpers */,
493-
E9C9E9E72C2D20D800C4AA34 /* Run Script */,
494501
);
495502
buildRules = (
496503
);
@@ -678,25 +685,6 @@
678685
/* End PBXResourcesBuildPhase section */
679686

680687
/* Begin PBXShellScriptBuildPhase section */
681-
E9C9E9E72C2D20D800C4AA34 /* Run Script */ = {
682-
isa = PBXShellScriptBuildPhase;
683-
alwaysOutOfDate = 1;
684-
buildActionMask = 2147483647;
685-
files = (
686-
);
687-
inputFileListPaths = (
688-
);
689-
inputPaths = (
690-
);
691-
name = "Run Script";
692-
outputFileListPaths = (
693-
);
694-
outputPaths = (
695-
);
696-
runOnlyForDeploymentPostprocessing = 0;
697-
shellPath = /bin/sh;
698-
shellScript = "#xcodebuild -workspace ../RuntimeViewer.xcworkspace -scheme \"RuntimeViewerCatalystHelper\" -sdk \"macosx\" -destination 'platform=macOS,variant=Mac Catalyst,name=Any Mac' -derivedDataPath /tmp/CustomDerivedData\n";
699-
};
700688
E9C9E9E92C2D296E00C4AA34 /* ShellScript */ = {
701689
isa = PBXShellScriptBuildPhase;
702690
alwaysOutOfDate = 1;
@@ -952,6 +940,7 @@
952940
};
953941
E9432FF02C0D614A00362862 /* Debug */ = {
954942
isa = XCBuildConfiguration;
943+
baseConfigurationReference = E95CDA672DAA970300D97B03 /* Debug.xcconfig */;
955944
buildSettings = {
956945
ALLOW_TARGET_PLATFORM_SPECIALIZATION = NO;
957946
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
@@ -987,8 +976,10 @@
987976
};
988977
E9432FF12C0D614A00362862 /* Release */ = {
989978
isa = XCBuildConfiguration;
979+
baseConfigurationReference = E95CDA682DAA970900D97B03 /* Release.xcconfig */;
990980
buildSettings = {
991981
ALLOW_TARGET_PLATFORM_SPECIALIZATION = NO;
982+
ARCHS = "$(ARCHS_STANDARD)";
992983
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
993984
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
994985
CODE_SIGN_ENTITLEMENTS = RuntimeViewerUsingAppKit/RuntimeViewerUsingAppKit.entitlements;
@@ -1159,7 +1150,7 @@
11591150
};
11601151
E9E900ED2C2D0D5B00FADDCC /* Debug */ = {
11611152
isa = XCBuildConfiguration;
1162-
baseConfigurationReference = E9C9E9C92C2D0E3C00C4AA34 /* Config.xcconfig */;
1153+
baseConfigurationReference = E95CDA652DAA6FA300D97B03 /* Debug.xcconfig */;
11631154
buildSettings = {
11641155
CODE_SIGN_STYLE = Automatic;
11651156
CREATE_INFOPLIST_SECTION_IN_BINARY = YES;
@@ -1175,7 +1166,7 @@
11751166
};
11761167
E9E900EE2C2D0D5B00FADDCC /* Release */ = {
11771168
isa = XCBuildConfiguration;
1178-
baseConfigurationReference = E9C9E9C92C2D0E3C00C4AA34 /* Config.xcconfig */;
1169+
baseConfigurationReference = E95CDA662DAA6FA900D97B03 /* Release.xcconfig */;
11791170
buildSettings = {
11801171
CODE_SIGN_STYLE = Automatic;
11811172
CREATE_INFOPLIST_SECTION_IN_BINARY = YES;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
SMPrivilegedExecutable = identifier "com.JH.RuntimeViewerService" and anchor apple generic and certificate leaf[subject.CN] = "Apple Development: JieHui Lai (4ZZALU97YZ)" and certificate 1[field.1.2.840.113635.100.6.2.1] /* exists */
2+
3+

RuntimeViewerUsingAppKit/RuntimeViewerUsingAppKit/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<key>SMPrivilegedExecutables</key>
2727
<dict>
2828
<key>com.JH.RuntimeViewerService</key>
29-
<string>identifier "com.JH.RuntimeViewerService" and anchor apple generic and certificate leaf[subject.CN] = "Apple Development: JieHui Lai (4ZZALU97YZ)" and certificate 1[field.1.2.840.113635.100.6.2.1] /* exists */</string>
29+
<string>$(SMPrivilegedExecutable)</string>
3030
</dict>
3131
<key>UTImportedTypeDeclarations</key>
3232
<array>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SMPrivilegedExecutable = anchor apple generic and identifier "com.JH.RuntimeViewerService" and (certificate leaf[field.1.2.840.113635.100.6.1.9] /* exists */ or certificate 1[field.1.2.840.113635.100.6.2.6] /* exists */ and certificate leaf[field.1.2.840.113635.100.6.1.13] /* exists */ and certificate leaf[subject.OU] = D5Q73692VW)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#include "Config.xcconfig"
2+
3+
SMAuthorizedClient = identifier "com.JH.RuntimeViewer" and anchor apple generic and certificate leaf[subject.CN] = "Apple Development: JieHui Lai (4ZZALU97YZ)" and certificate 1[field.1.2.840.113635.100.6.2.1] /* exists */

RuntimeViewerUsingAppKit/com.JH.RuntimeViewerService/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<string>1</string>
1515
<key>SMAuthorizedClients</key>
1616
<array>
17-
<string>identifier "com.JH.RuntimeViewer" and anchor apple generic and certificate leaf[subject.CN] = "Apple Development: JieHui Lai (4ZZALU97YZ)" and certificate 1[field.1.2.840.113635.100.6.2.1] /* exists */</string>
17+
<string>$(SMAuthorizedClient)</string>
1818
</array>
1919
</dict>
2020
</plist>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#include "Config.xcconfig"
2+
3+
SMAuthorizedClient = anchor apple generic and identifier "com.JH.RuntimeViewer" and (certificate leaf[field.1.2.840.113635.100.6.1.9] /* exists */ or certificate 1[field.1.2.840.113635.100.6.2.6] /* exists */ and certificate leaf[field.1.2.840.113635.100.6.1.13] /* exists */ and certificate leaf[subject.OU] = D5Q73692VW)

exportTest.plist

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>method</key>
6+
<string>mac-application</string>
7+
<key>compileBitcode</key>
8+
<false/>
9+
</dict>
10+
</plist>

0 commit comments

Comments
 (0)