天天看点

iOS开发那些-如何打包iOS应用程序

我们把应用上传到app store之前需要把编译的二进制文件和资源文件打成压缩包,压缩格式是zip。

首页找到编译到什么地方,这个很重要也不太好找,我们可以看看编译日志,找到其中的create universal binary helloworld…的内容,然后展开内容如下:

create universal binary /users/tonyguan/library/developer/xcode/deriveddata/helloworld-fzvtlfsmygaqjleczypphenzabef/build/products/release-iphoneos/helloworld.app/helloworld normal ”armv7 armv7s”

cd ”/users/tonyguan/desktop/19.1.4 helloworld”

setenv path ”/applications/xcode.app/contents/developer/platforms/iphoneos.platform/developer/usr/bin:/applications/xcode.app/contents/developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin”

lipo -create /users/tonyguan/library/developer/xcode/deriveddata/helloworld-fzvtlfsmygaqjleczypphenzabef/build/intermediates/helloworld.build/release-iphoneos/helloworld.build/objects-normal/armv7/helloworld /users/tonyguan/library/developer/xcode/deriveddata/helloworld-fzvtlfsmygaqjleczypphenzabef/build/intermediates/helloworld.build/release-iphoneos/helloworld.build/objects-normal/armv7s/helloworld -output /users/tonyguan/library/developer/xcode/deriveddata/helloworld-fzvtlfsmygaqjleczypphenzabef/build/products/release-iphoneos/helloworld.app/helloworld

在最后日志-output之后就是应用编译之后的位置了,其中“/users/tonyguan/library/… /products/release-iphoneos/”是编译之后生成的目录,helloworld.app是包文件,helloworld是二进制文件。

iOS开发那些-如何打包iOS应用程序

包文件helloworld.app可以使用点击右键菜单“显示包内容”,其中helloworld文件是我们这个应用的二进制文件。其它的都是资源文件,包括图片、属性列表文件、nib和storyboardc文件,nib是编译之后的xib文件,storyboardc是编译之后的故事板文件等。

iOS开发那些-如何打包iOS应用程序

应用打包就是将helloworld.app包文件打包成为helloworld.zip,具体操作是右键点击helloworld.app包文件弹出菜单,选择压缩“helloworld”,这样就会在当前目录下生成helloworld.zip压缩文件了,请将这个文件保存好,我们会在下一节介绍,上传应用时候还会使用到。

iOS开发那些-如何打包iOS应用程序