使用 Xcode 6 测试 Mac 安装程序包
Posted
技术标签:
【中文标题】使用 Xcode 6 测试 Mac 安装程序包【英文标题】:Testing the Mac Installer Package using Xcode 6 【发布时间】:2014-11-07 18:09:18 【问题描述】:在将我的 Mac App 提交到 App Store 之前,我习惯于测试以下安装包 这里描述的过程:
Testing the Mac Installer Package - Apple documentation
这主要涉及归档应用程序,导出为 Mac 安装程序包并使用以下方式安装:
sudo installer -store -pkg .... -target /
自从我更新到 Xcode 6 后,我在启动应用程序时总是遇到签名错误 [EXC_CRASH (Code Signature Invalid)]:
Process: ......... [1749]
Path: /Applications/.........
Identifier: ......
Version: ???
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: .......... [1749]
User ID: 501
Date/Time: 2014-11-07 18:52:45.292 +0100
OS Version: Mac OS X 10.10 (14A389)
Report Version: 11
Anonymous UUID: 142A2C49-B327-E26A-0DE4-0CCB99AC1DC0
Sleep/Wake UUID: 174FDF51-B783-4172-952B-EB8E5B07D436
Time Awake Since Boot: 2700 seconds
Time Since Wake: 690 seconds
Crashed Thread: 0
Exception Type: EXC_CRASH (Code Signature Invalid)
Exception Codes: 0x0000000000000000, 0x0000000000000000
kernel messages:
VM Regions Near 0x7fff75cbe0a8 (cr2):
__LINKEDIT 00007fff68263000-00007fff68277000 [ 80K] r--/rwx SM=COW /usr/lib/dyld
--> Submap 00007fff70000000-00007fff80000000 [256.0M] r--/rwx SM=PRV process-only VM submap
unused shlib __DATA 00007fff749e7000-00007fff76f76000 [ 37.6M] rw-/rw- SM=COW system shared lib __DATA not used by this process
Thread 0 Crashed:
0 dyld 0x00007fff681f4000 _dyld_start + 0
Thread 0 crashed with X86 Thread State (64-bit):
rax: 0x000000000000000d rbx: 0x0000000000000000 rcx: 0x0000000000000000 rdx: 0x0000000000000000
rdi: 0x0000000000000000 rsi: 0x0000000000000000 rbp: 0x0000000000000000 rsp: 0x00007fff556dcb50
r8: 0x0000000000000000 r9: 0x0000000000000000 r10: 0x0000000000000000 r11: 0x0000000000000000
r12: 0x0000000000000000 r13: 0x0000000000000000 r14: 0x0000000000000000 r15: 0x0000000000000000
rip: 0x00007fff681f4000 rfl: 0x0000000000000201 cr2: 0x00007fff75cbe0a8
Logical CPU: 0
Error Code: 0x020000f4
Trap Number: 133
Binary Images:
0x7fff681f3000 - 0x7fff68229837 dyld (???) <4696A982-1500-34EC-9777-1EF7A03E2659> /usr/lib/dyld
External Modification Summary:
Calls made by other processes targeting this process:
task_for_pid: 0
thread_create: 0
thread_set_state: 0
Calls made by this process:
task_for_pid: 0
thread_create: 0
thread_set_state: 0
Calls made by all processes on this machine:
task_for_pid: 1226
thread_create: 0
thread_set_state: 0
VM Region Summary:
ReadOnly portion of Libraries: Total=300K resident=288K(96%) swapped_out_or_unallocated=12K(4%)
Writable regions: Total=8420K written=0K(0%) resident=12K(0%) swapped_out=0K(0%) unallocated=8408K(100%)
REGION TYPE VIRTUAL
=========== =======
STACK GUARD 56.0M
Stack 8192K
VM_ALLOCATE 8K
VM_ALLOCATE (reserved) 4K reserved VM address space (unallocated)
__DATA 228K
__LINKEDIT 80K
__TEXT 220K
mapped file 1044K
shared memory 4K
=========== =======
TOTAL 65.6M
TOTAL, minus reserved VM space 65.5M
Model: MacBookPro11,1, BootROM MBP111.0138.B11, 2 processors, Intel Core i7, 2.8 GHz, 16 GB, SMC 2.16f68
Graphics: Intel Iris, Intel Iris, Built-In
Memory Module: BANK 0/DIMM0, 8 GB, DDR3, 1600 MHz, 0x80AD, 0x484D54343147533641465238412D50422020
Memory Module: BANK 1/DIMM0, 8 GB, DDR3, 1600 MHz, 0x80AD, 0x484D54343147533641465238412D50422020
AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x112), Broadcom BCM43xx 1.0 (7.15.124.12.8)
Bluetooth: Version 4.3.0f10 14890, 3 services, 27 devices, 1 incoming serial ports
Network Service: Wi-Fi, AirPort, en0
Serial ATA Device: APPLE SSD SM0512F, 500.28 GB
USB Device: Internal Memory Card Reader
USB Device: Apple Internal Keyboard / Trackpad
USB Device: BRCM20702 Hub
USB Device: Bluetooth USB Host Controller
Thunderbolt Bus: MacBook Pro, Apple Inc., 17.2
与使用 Xcode 5 时没有此问题的应用完全相同。
有什么建议吗?
这让我抓狂,因为我没有信心将应用程序提交给 Apple。
【问题讨论】:
【参考方案1】:我最终联系了 Apple 支持,他们回答说程序是:
1) Export your app as a Mac Application
2) productbuild --component <APP>.app /Applications <APP>.pkg --sign "3rd Party Mac Developer Installer:"
3) sudo installer -store -pkg <APP>.pkg -target /
文档没有提到第 2 点!
【讨论】:
关于第2步),我应该有两个文件(.app和.pkg)吗? 不是。我解决了。第二个 .pkg 是要创建的。谢谢【参考方案2】:这似乎不会影响应用审核。如果您的存档已通过验证,您只需提交您的应用,从应用商店下载该应用即可正常运行。
【讨论】:
是的,但我喜欢在发布之前测试应用程序。看我的回答。【参考方案3】:Apple 的 Technical Q&A QA1884 文档(日期为 2015-01-26)涵盖了这个主题:
当我运行我的 Mac 应用程序时,它立即崩溃,并且崩溃日志显示异常类型:EXC_CRASH(代码签名无效)。这是怎么回事?
... Mac 应用程序的分发版本不能直接运行;它们仅用于提交到 iTunes Connect 以供应用审核。
该文档提出了一些解决方法。
【讨论】:
以上是关于使用 Xcode 6 测试 Mac 安装程序包的主要内容,如果未能解决你的问题,请参考以下文章
如何在 Mac OSX 10.6.4 Snow leopard 中使用 iOS 5 安装 xcode 4.2
如何使用 Xcode 6.1 分发测试版 Mac App Store 应用程序?