美文网首页
怎样为项目快速打包测试

怎样为项目快速打包测试

作者: liusong007 | 来源:发表于2016-05-19 23:49 被阅读569次

    转载自cocoachina------simonwang

    不使用开发者账号注册的证书与配置文件就能进行打包

    style="font-family: 'Helvetica Neue'; font-size:

    14px;">[url]http://blog.sina.com.cn/s/blog_b92c82d90102w7jr.html[/url]

    在项目开发后期,为了测试,项目打包是必不可少的!打包要使用开发者账号注册的证书与配置文件,也是比较麻烦的。

    下面我分享下不使用开发者账号注册的证书与配置文件该如何打包项目。

    首先我们在mac电脑中的Launchpad找到钥匙串访问并打开:

    上传中...

    在屏幕菜单栏中选择证书助理并创建(将证书信任权限选择始终信任);

    之后我们开始配置文件:

    打开终端

    输入命令:

    cd

    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk

    (iPhoneOS9.2.sdk是变量根据每个人xcode版本不同sdk也会不用,如不知道自己的xcode sdk可以通过Finder找到)

    上传中...

    之后输入:

    sudo cp SDKSettings.plist SDKSettings.plist.orig

    cd ..

    sudo chmod -R 777 iPhoneOS.sdk

    open .

    将SDKSettings.plist表中DefaultProperties的ENTITLEMENTS_REQUIRED和CODE_SIGNING_REQUIRED设置为NO

    扩展:

    sudo chmod 777 -R xxx (更改文件夹及其子文件夹权限为777)sudo chmod 600 ×××(只有所有者有读和写的权限)

    sudo chmod 644 ×××(所有者有读和写的权限,组用户只有读的权限)

    sudo chmod 700 ×××(只有所有者有读和写以及执行的权限)

    sudo chmod 666 ×××(每个人都有读和写的权限)

    sudo chmod 777 ×××(每个人都有读和写以及执行的权限

    设置完成后,回到终端

    输入:

    cd

    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform

    sudo cp Info.plist Info.plist.orig

    sudo chmod -R 777 iPhoneOS.platform

    open .

    将Info.plist表中DefaultProperties、RuntimeRequirements、OverrideProperties分支下的XCiPhoneOSCodeSignContext设置为XCCodeSignContext

    此时我们的配置完成了。。。接下来

    确保网络通畅的情况下

    终端输入:

    sudo mkdir /Applications/Xcode.app/Contents/Developer/iphoneentitlements

    cd /Applications/Xcode.app/Contents/Developer/iphoneentitlements

    sudo curl -Ohttp://www.alexwhittemore.com/iphone/gen_entitlements.txt

    sudo mv gen_entitlements.txtgen_entitlements.py

    sudo chmod 777gen_entitlements.py

    现在我们开始进行Xcode设置与项目打包

    首先将我们需要打包的项目工程打开

    设置“TARGETS-Build Settings-Code Signing-Don’t Code Sign”

    上传中...

    Product-Scheme-Edit  Scheme

    上传中...

    设置Run-Info-Build Configuration-Release

    上传中...

    设置完成后,Command+Shift+R运行;

    通过Finder找到/User/用户名/Library/Developer/Xcode/DerivedData或/用户/用户名/资源库/Developer/Xcode/DerivedData路径下找到自己的项目文件选择

    Build-Products-Release-iphones

    上传中...

    将上面的文件拖拽到iTunes中

    上传中...

    生成文件后在拖出去就会生成ipa包

    上传中...

    相关文章

      网友评论

          本文标题:怎样为项目快速打包测试

          本文链接:https://www.haomeiwen.com/subject/tfogrttx.html