简体   繁体   English

如何更改静态库的代码.a文件Xcode项目的另一个Xcode项目?

[英]How to change code of static library .a file Xcode Project for another Xcode project?

Scenario like, 场景如,

I have two xcode projects which has git repo. 我有两个有git repo的xcode项目。

Second Xcode project does not have target to run app in Device, But it has libProject.a target and lots of lines of code. 第二个Xcode项目没有在Device中运行应用程序的目标,但它有libProject.a目标和许多代码行。

First Xcode project has target to run app in Device and it uses above .a library by CocoaPod mechanism. 第一个Xcode项目的目标是在Device中运行app,它通过CocoaPod机制使用上面的.a库。

Now i want to update few things in Second Xcode project and wants to check in device, than pull update to First xcode project. 现在我想在Second Xcode项目中更新一些内容并想要检查设备,而不是将更新提取到First xcode项目。 both projects belonds to git repo. 这两个项目都属于git repo。

I had tried with to commit push of Second project and update pod of First project, But i could not get it. 我曾尝试过推进第二个项目并更新第一个项目的pod,但我无法得到它。

Edit* First Xcode project has workspace too.. 编辑*第一个Xcode项目也有工作区..

************ New Edit ************ something happening now. ************新编辑************现在发生了什么事。 I have update code lines in static library which should be available to unit test only. 我在静态库中有更新代码行,只能用于单元测试。 I have did it. 我做到了。 Now i have commit this code lines to new branch and make it default. 现在我已将此代码行提交到新分支并使其成为默认值。 But when i going to update pod of static library from terminal i could not see changes in First Code workspace project. 但是当我要从终端更新静态库的pod时,我看不到First Code工作区项目的变化。

在此输入图像描述

please advise how to do this. 请告知如何做到这一点。

Finally I got it. 终于我明白了。

Step 1. 第1步。

Update code in static library and do unit test. 更新静态库中的代码并进行单元测试。 B'coz it is not like other project which has Device target. B'coz它不像其他具有Device目标的项目。

Step 2. 第2步。

Commit code and push to git. 提交代码并推送到git。 And make sure your commited code branch should be default one. 并确保您提交的代码分支应该是默认代码分支。 If not merge to default or make it default branch. 如果没有合并到默认值或使其成为默认分支。

Step 3. 第3步。

Edit Pod file of First xcode project which is using Cocoapod mechnism. 编辑正在使用Cocoapod mechnism的First xcode项目的Pod文件。

Like 喜欢

pod 'Name', :git => 'git@github.com:name.git’, :branch => ‘Default branch name'

Add branch here only. 仅在此处添加分支。

Step 4. 第四步。

Update this pod only. 仅更新此广告连播。 By terminal command. 通过终端命令。

pod update podname

And got the update from static library. 并从静态库获得更新。

You can create workspace and add there First and Second project. 您可以创建工作区并添加第一个和第二个项目。 And then in second project add linkage with library of 1st project. 然后在第二个项目中添加与第一个项目库的链接。 Any updates of library in First project will be automatically picked up by second project. 第一个项目中库的任何更新都将由第二个项目自动获取。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM