0

我已经为 ios 创建了一个 phonegap 项目。我使用 phonegap 命令行来构建./cordova/build. 然后我用xcrun生成一个ipa,它失败了。

这是我的命令行:

xcrun -sdk iphoneos PackageApplication -v ./build/page.app -o ~/Documents  
/ipas/page.ipa -sign "iPhone Distribution: [XXXXXXX]" -embed "XXX.mobileprovision"

这是我执行命令后得到的错误。

Output directory: '/Users/longfei/Documents/ipas/page.ipa'
Temporary Directory: '/var/folders/n9/1pqsg0kj667d741s43cfnlw80000gn/T/kLf7Emmi2L'  (will NOT be deleted on exit when verbose set)
+ /bin/cp -Rp ./build/page.app /var/folders/n9/1pqsg0kj667d741s43cfnlw80000gn/T/kLf7Emmi2L/Payload
Program /bin/cp returned 0 : []
Checking original app
+ /usr/bin/codesign --verify -vvvv ./build/page.app
Program /usr/bin/codesign returned 1 : [./build/page.app: code object is not signed at all
In architecture: i386
]
Codesign check fails : ./build/page.app: code object is not signed at all
In architecture: i386

Done checking the original app
Embedding '~/Dropbox/Works/xcode/zs/yunsite1/yunsite1.mobileprovision'
+ /bin/rm -rf /var/folders/n9/1pqsg0kj667d741s43cfnlw80000gn/T/kLf7Emmi2L/Payload/page.app/embedded.mobileprovision
Program /bin/rm returned 0 : []
+ /bin/cp -rp ~/Dropbox/Works/xcode/zs/yunsite1/yunsite1.mobileprovision /var/folders/n9/1pqsg0kj667d741s43cfnlw80000gn/T/kLf7Emmi2L/Payload/page.app/embedded.mobileprovision
Program /bin/cp returned 1 : [cp: ~/Dropbox/Works/xcode/zs/yunsite1/yunsite1.mobileprovision: No such file or directory
]
error: Unable to copy '~/Dropbox/Works/xcode/zs/yunsite1/yunsite1.mobileprovision' to '/var/folders/n9/1pqsg0kj667d741s43cfnlw80000gn/T/kLf7Emmi2L/Payload/page.app/embedded.mobileprovision'

我是 ios 和 phonegap 的新手。我已经搜索了很长时间以获得解决方案,但失败了。希望您能够帮助我。非常感谢。

4

1 回答 1

1

您的命令行看起来不错(类似于我的)。您的问题是您正在签署 phonegap 构建的调试版本。错误在那里:

Codesign check fails : ./build/page.app: code object is not signed at all
In architecture: i386

调试版本是 i386 二进制文件,因此它们可以在 Mac 上运行,但发布版本是 ARM 二进制文件。我不使用 phonegap 进行构建,但您需要构建 Release 版本才能签名。我在我的makefile中做这样的构建:

ios-app:
        echo 'MAKE SURE YOU HAVE DONE security unlock-keychain login.keychain'
        cd $(ios_dir);xcodebuild -target $(app_name) -project $(app_name).xcodeproj -target $(app_name) -configuration Release CODE_SIGN_IDENTITY=$(sign_identity) CONFIGURATION_BUILD_DIR=`pwd`/build
        cd $(ios_dir);xcrun -sdk iphoneos PackageApplication $(ios_dir)/build/$(app_name).app -o $(ios_dir)/build/$(app_name).ipa -sign $(sign_identity) --embed $(cert_name)  -verbose

底线是您需要签署正确的软件包版本。

于 2013-08-29T15:44:14.497 回答