Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
How to create Apple framework for iOS?
AlexeyPuzankov last edited by
Is it possible create iOS Apple Framework?
Here documentation how to create Apple framework: http://doc.qt.io/qt-5/qmake-platform-notes.html#creating-frameworks
CONFIG += lib_bundle
available only for Mac OS X (http://doc.qt.io/qt-5/qmake-variable-reference.html#config)
XCode allows to create frameworks for all platforms (macOS, iOS, watchOS...).
Hi and welcome to devnet,
That's likely because until recently, Apple was forbidding the use of Frameworks in iOS applications i.e. only static builds (not counting the system Frameworks).
As for now, you should bring this point to the interest mailing list. You'll find there Qt's developers/maintainers. This forum is more user oriented.
shav last edited by shav
As I know for now Qt doesn't have any simple way for create framework for iOS platform. But you can do it yourself. I post a link to article where you can read about how you can create framework from static library in Xcode. If you want you can use bash script from article in your project. The link to article here.
Also I done a simple script for you (this script works but you need do a few steps to start work with it):
Create a folder where you will run script.
Copy to this folder my script and two version of static libraries: one for device and second for simulator.
Create headers folder and copy to it all your public headers file for your framework.
Open terminal and move to folder which you created in step 1.
Run script with parameters:
./generate_framework.sh -framework_path <path_to_framework> -headers <full_path_to_public_headers> -project_name <name_of_framework> -device_lib <path_to_device_static_library> -sim_lib <path_to_simulator_library>
Why you need two versions of library? Because you need to support both device and simulator. You can use only one lib file but in this case you will build project on ios only for one device or simulator. So I recomend to build both version of library and then use it with my script.
Hope this will help!
Stefankm last edited by
I know this post is quite old, but I am currently struggeling with turning a lib into a framework with qmake. Would you perhaps mind resharing your build script. The old link is dead, but perhpas I can learn from your script what I am doing wrong.
Many thanks for your help!
shav last edited by
Sorry, I'm updated the link to archive with script for create framework. Please, use this link.
Stefankm last edited by
@shav Thanks a lot for your kind help!