可以更改Info.自定义框架的信息,手动在设备上安装时会出现问题吗?
我使用lipo -create
命令从Xcode项目中制作了一个自定义框架,通过加入模拟器和iPhone体系结构框架。因此,它在info.plist
文件中默认情况下具有捆绑包标识符“ example.com.a”。 我可以在设备上使用此框架,并在设备上安装该框架,而没有任何错误
当我尝试将自定义框架的捆绑符号标识符更改为诸如“ myApp.custom.framework”之类的东西时, 。框架文件夹而不是Xcode项目。
通过这样做,我无法在设备中安装.IPA。它显示“无法安装应用程序”。
因此,我的问题是
1)正在手动更改捆绑包标识符或在自定义框架的信息中添加键。Plist会影响自定义框架功能
吗? 2)用于更改自定义框架的捆绑包标识符,我们需要在主Xcode项目中更改它?现在,我正在更改和添加info.plist中的键。
I made a custom framework from a xcode project with "example.com.a" bundle identifier using lipo -create
command by joining simulator and iphone architecture frameworks. So it has a bundle identifier "example.com.a" in it's info.plist
file by default. I am able to use this framework in my app and my app installs on device without any error
Now when i try to change the bundle identifier of the custom framework to something like "myapp.custom.framework" by manually editing the info.plist inside the framework folder instead of xcode project .
By doing this I am unable to install the .ipa in the device. It shows "Unable to install the app".
So my question is
1) Is manually changing the bundle identifier or adding keys to custom framework's info.plist affects the custom framework functionality ?
2) For changing the bundle identifier of custom framework do we need to change it in the main xcode project? Right now i am changing and adding keys in the info.plist which is there in framework folder.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
经过长期的研究和试验,我发现,如果我们更改info.plist在自定义框架文件夹中的捆绑包标识符,它将在添加示例项目时会产生错误,相反,我们需要从Xcode Project中更改框架项目以进行框架和框架。然后生成iPhone和Simulator
.framework
,然后使用Lipo -eReate Output
将它们组合起来并创建通用库。以下是:
构建和分发通用/胖框架:
在框架项目中:
为模拟器构建Xcode框架项目并为设备构建,这将在派生的数据文件夹中产生两个框架。
找到项目的派生数据路径。查找文件夹
build-> product
s。内部应该是“ -iphoneos”和“ -iphonesimulator”。每个内部是一个.framework文件夹。将其中一个复制到一些不错的文件夹。从每个.frawework文件夹中,将所在的二进制文件复制到一个文件夹中。在终端中:
在终端运行命令
lipo -reate -output< outputname> < binaryfromiphoneos> < binaryfromiphonesimulator>
。这将为模拟器和设备的所有体系结构创建一个胖二进制文件。替换已复制的.framework目录中的一个新生成的版本,最好在iPhone平台框架的文件夹中。运行
lipo -info<框架路径>
在终端中了解框架的体系结构。例如:x86表示模拟器,ARM64,ARM7表示iPhone设备。要在另一个应用程序中使用该框架:
项目
,选择目标,然后选择常规
TAB。< frameworkname/frameworkname.h>
在源代码中导入文件After long research and trial i found that if we change the bundle identifier in info.plist inside the custom framework folder, it will create error while adding in a sample project, instead we need to change the bundle identifier from the XCode project for framework and then generate iPhone and Simulator
.framework
and uselipo -create output
to combine them and create a universal library.Following are the steps :
To build and distribute universal/fat frameworks:
In the framework project:
Build xcode framework project for simulator and build for device, this will produce two frameworks in the derived data folder.
Find the derived data path for the project. Look for the folder
Build->Product
s. Inside it should be '-iphoneos' and '-iphonesimulator'. Inside each is a .framework folder. Copy one of those to some nice folder. From each of those .frawework folders, copy the binary that is in there to one folder.In Terminal:
In terminal run the command
lipo -create -output <outputName> <binaryFromiphoneos> <binaryFromiphonesimulator>
. This will create a fat binary with all architectures for both simulator and devices. Replace the one in the copied .framework directory with the newly generated one preferably inside the folder of iPhone platform framework.Run
lipo -info <framework path>
in terminal to know about the architecture of the framework . Eg: X86 denotes simulator , arm64, arm7 denotes iphone devices.To use the framework in another app:
Project
in the Project Navigator, select the target, and selectGeneral
tab.<frameworkName/frameworkName.h>