Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

Second Xcode project does not have target to run app in Device, But it has libProject.a target and lots of lines of code.

First Xcode project has target to run app in Device and it uses above .a library by CocoaPod mechanism.

Now i want to update few things in Second Xcode project and wants to check in device, than pull update to First xcode project. both projects belonds to git repo.

I had tried with to commit push of Second project and update pod of First project, But i could not get it.

Edit* First Xcode project has workspace too..

************ 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.

enter image description here

please advise how to do this.

like image 456
Solid Soft Avatar asked Jan 28 '16 07:01

Solid Soft


People also ask

How can I use an .a static library in Swift?

Yes, you can use static libraries in Swift. Go to your Build Phases and under "Link Binary With Libraries" and add them there. Alternatively, you can go under Build Settings and in "Search Paths" append the "Library Search Paths" value to include the path to the folder that your . a file is in.

Is XCFramework static or dynamic?

An XCFramework can be either static or dynamic and can include headers.

Where is library search paths in Xcode?

The libraries will be located under lib .


1 Answers

Finally I got it.

Step 1.

Update code in static library and do unit test. B'coz it is not like other project which has Device target.

Step 2.

Commit code and push to git. And make sure your commited code branch should be default one. If not merge to default or make it default branch.

Step 3.

Edit Pod file of First xcode project which is using Cocoapod mechnism.

Like

pod 'Name', :git => '[email protected]: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.

like image 120
Solid Soft Avatar answered Oct 16 '22 19:10

Solid Soft