Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
0
Question by JooOwl · Jun 25, 2020 at 07:57 AM · iosbuildxcode

How do I access [Link Binary With Libraries] within Build Phases in Xcode with PBXProject?

Hello, I am a developer who is developing as Unity in Korea.

I'm not good at English, so I write with a translator.

I'm currently trying to automate IOS build.

How do I access [Link Binary With Libraries] within Build Phases in Xcode with PBXProject?

alt text
https://drive.google.com/file/d/1g1hKUvD5fzyUhhU4uiKYGwrcErhvGVKQ/view?usp=sharing

[Link Binary With Libraries] I want to approach and add the Libraries I want, but it's not easy.

================================================================
string filename = APP_NAME;
string strOutputDir = Directory.GetCurrentDirectory() + "/" + TARGET_DIR; ;
string projectPath = path + "/Unity-iPhone.xcodeproj/project.pbxproj";

PBXProject pbxProject = new PBXProject();
pbxProject.ReadFromFile(projectPath);

string str_Main_Guid = pbxProject.GetUnityMainTargetGuid();
string str_Framework_Guid = pbxProject.GetUnityFrameworkTargetGuid();
================================================================

I made it like this. I don't know anymore.

If anyone knows, please teach me.

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

안녕하세요. 저는 한국에서 유니티로 개발중인 개발자입니다.

영어를 잘 하지 못하여서 번역기로 글을 남겨요.

현재 IOS 빌드 자동화를 해볼려고 만드는 중인데.

PBXProject로 Xcode 에서 Build Phases 안에 [Link Binary With Libraries] 에 접근을 어떻게 하나요.

[Link Binary With Libraries] 접근을 하여서 제가 원하는 Librarie를 추가하고 싶은데 쉽지가 않네요.

================================================================
string filename = APP_NAME;

string strOutputDir = Directory.GetCurrentDirectory() + "/" + TARGET_DIR; ;
string projectPath = path + "/Unity-iPhone.xcodeproj/project.pbxproj";

PBXProject pbxProject = new PBXProject();
pbxProject.ReadFromFile(projectPath);

string str_Main_Guid = pbxProject.GetUnityMainTargetGuid();
string str_Framework_Guid = pbxProject.GetUnityFrameworkTargetGuid();
================================================================

이렇게 만들었는데. 더 이상 잘 모르겠습니다.

혹시 아시는분 있으시면 저에게 가르침을 주세요.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by UgurhanBilici · Jan 21, 2021 at 02:56 PM

Hello! We had a similar issue and found out a way to link our binaries. First, you need to get the corrent phase guids, which is "Link Binaries With Libraries";

 var unityLinkPhaseGuid = pbxProject.GetFrameworksBuildPhaseByTarget(str_Main_Guid);
 var unityFrameworkLinkPhaseGuid = pbxProject.GetFrameworksBuildPhaseByTarget(str_Framework_Guid);

Then you need to add your frameworks to these phases;

     // targetFrameworkGuid is guid of the binary you want to link with libraries.
     // If you provide the framework, you should use pbxProject.AddFile() 
     // and use the returned guid
     
     pbxProject.AddFileToBuildSection(str_Main_Guid, unityLinkPhaseGuid, targetFrameworkGuid);
     pbxProject.AddFileToBuildSection(str_Framework_Guid, unityFrameworkLinkPhaseGuid, targetFrameworkGuid);

After doing these and write all to pbxProject, your linking phase should be correct. You might still need to embed your frameworks. Use pbxProject.AddFileToEmbedFrameworks() to embed your frameworks.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by ltomov · Apr 01, 2021 at 09:41 AM

This is also possible:

pbxProject.AddFrameworkToProject(targetGUID, "AppTrackingTransparency.framework", true);

"true" will add the framework in the "Link Binary With Libraries" section with status "Optional", "false" will be "Required".

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

252 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Xcode stuck / hangs when compiling source files for Unity project 5 Answers

iOs build fails on 5.3 1 Answer

add new bool item to info.plist with UnityEditor.iOS.Xcode 2 Answers

converting managed assemblies to c++ building to ios and unity crashes 1 Answer

Objects with animation disappear in IOS build. 6 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges