{"id":21373625,"url":"https://github.com/itenfay/ios-sdk-dev-demo","last_synced_at":"2025-07-13T08:30:26.656Z","repository":{"id":113235790,"uuid":"188252125","full_name":"itenfay/ios-sdk-dev-demo","owner":"itenfay","description":"一个简单封装的iOS SDK，提供demo及制作教程。(A simple wrapping SDK for iOS, provides demo and production tutorials.)","archived":false,"fork":false,"pushed_at":"2023-06-26T07:31:21.000Z","size":1256,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-07T07:41:30.124Z","etag":null,"topics":["complie-sources","course","framework","ios","ios-sdk","ios-sdk-demo","library","lipo","mach","mach-o","production-tutorials","sdk","sdk-prodution-turorials","static-library","tutorials"],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/itenfay.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-05-23T14:38:32.000Z","updated_at":"2025-04-01T03:51:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"385c6991-02d2-44e4-b74b-bf5d770efaab","html_url":"https://github.com/itenfay/ios-sdk-dev-demo","commit_stats":null,"previous_names":["itenfay/ios-sdk-dev-demo"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/itenfay/ios-sdk-dev-demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itenfay%2Fios-sdk-dev-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itenfay%2Fios-sdk-dev-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itenfay%2Fios-sdk-dev-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itenfay%2Fios-sdk-dev-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/itenfay","download_url":"https://codeload.github.com/itenfay/ios-sdk-dev-demo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itenfay%2Fios-sdk-dev-demo/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265109654,"owners_count":23712724,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["complie-sources","course","framework","ios","ios-sdk","ios-sdk-demo","library","lipo","mach","mach-o","production-tutorials","sdk","sdk-prodution-turorials","static-library","tutorials"],"created_at":"2024-11-22T08:29:25.547Z","updated_at":"2025-07-13T08:30:26.238Z","avatar_url":"https://github.com/itenfay.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"[如果此项目能帮助到你，就请你给一颗星。谢谢！(If this project can help you, please give it a star. Thanks!)](https://github.com/chenxing640/ios-sdk-dev-demo)\n\n[![License MIT](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](LICENSE)\u0026nbsp;\n\n## ios-sdk-dev-demo\n\n- 一个简单封装的iOS SDK，编写于2015年3月23日，提供demo及制作教程。\n\n- 目录说明\n    - ExamSdk为**SDK源码**。\n    - ExamSdkDemo为**集成SDK后的demo**。\n\n- 代码有点旧，勿喷！当需要制作自己的SDK时，请参考本仓库项目或者下文的[制作教程](#Production-tutorials)。\n\n## Group (ID:614799921)\n\n\u003cdiv align=left\u003e\n\u0026emsp; \u003cimg src=\"https://github.com/chenxing640/ios-sdk-dev-demo/raw/master/images/g614799921.jpg\" width=\"30%\" /\u003e\n\u003c/div\u003e\n\n## Preview\n\n- SDK Library\n\n\u0026emsp; ![](https://github.com/chenxing640/ios-sdk-dev-demo/raw/master/images/SimpleSDK_Lib.png)\n\n- 实现功能\n\n\u003cdiv align=left\u003e\n\u0026emsp; \u003cimg src=\"https://github.com/chenxing640/ios-sdk-dev-demo/raw/master/images/simple_sdk_preview.gif\" width=\"30%\" /\u003e\n\u003c/div\u003e\n\n## Production tutorials\n\n1. 创建模板\n\n\u0026emsp; ![](https://github.com/chenxing640/ios-sdk-dev-demo/raw/master/images/lib_templete_create.png)\n\n①是创建.framework模板，②是创建.a模板。\n\n2. Project -\u003e Target -\u003e Build Settings 搜索 iOS Deployment Target\n\n选择SDK的最小兼容部署，如iOS 8.0。\n\n3. Project -\u003e Target -\u003e Build Settings 搜索 Valid Architectures\n\n目前支持的架构：真机(arm64 armv7s)、模拟器(i386 x86_64)。不用再支持armv7架构，以后也不需要支持armv7s架构。\n\n4. Project -\u003e Target -\u003e Build Settings 搜索 Mach-O Type\n\nMach-O Type选项有Dynamic Library, Static Library, Bundle, Executable等，选择Dynamic Library制作动态库，Static Library制作静态库，Bundle存储资源文件。\n\n### 补充知识：\n\n- 库是共享程序代码的方式，一般分为静态库和动态库。\n    - 静态库：链接时完整地拷贝至可执行文件中，被多次使用就有多份冗余拷贝。\n    - 动态库：链接时不复制，程序运行时由系统动态加载到内存，供程序调用，系统只加载一次，多个程序共用，节省内存。\n    - iOS里静态库形式：.a和.framework \n    - iOS里动态库形式：.dylib, .tbd和.framework \n\n- framework为什么既有静态库又有动态库：\n    - 系统的.framework是动态库，我们自己建立的.framework一般设置成静态库，也可以设置成动态库。\n\n- .a与.framework有什么区别：\n    - .a是一个纯二进制文件，.framework中除了有二进制文件之外还有资源文件。\n    - .a文件不能直接使用，至少要有.h文件配合，.framework文件可以直接使用。\n    - .a + .h + sourceFile = .framework。\n    - 建议用.framework.。\n\n- 为什么要使用静态库：\n    - 方便共享代码，便于合理使用。\n    - 实现iOS程序的模块化。可以把固定的业务模块化成静态库。\n    - 和别人分享你的代码库，但不想让别人看到你代码的实现。\n    - 开发第三方SDK的需要。\n\n5. Project -\u003e Target -\u003e Build Settings 搜索 Dead Code Stripping\n\n在Link选项中将Dead Code Stripping改为NO (默认是YES)。确定 Dead Code（代码被定义但从未被调用）被剥离，去掉冗余的代码，即使一点冗余代码，编译后体积也是很可观的。\n\n6. Project -\u003e Target -\u003e Build Settings 搜索 Debug Information Format\n\n在Debug Information Format选项中将DWARF with dSYM File修改成DWARF，不生成dSYM文件。\n\n7. Project -\u003e Target -\u003e Build Phases -\u003e Complie Sources\n\n添加要编译.h .m文件，Xcode自动将.m文件添加到Complie Sources中，同时可以使用-fno-objc-arc, fobjc-arc分别针对特定的.m文件进行MRC，ARC内存管理。\n\n8. Project -\u003e Target -\u003e Build Phases -\u003e Headers\n\n将工程Project要暴露的接口.h头文件拖到Public中。framework支持模块化，SDK命名尽量不要头文件重名，以便集成SDK时模块(@import xxx)不能使用。SDK资源放到一个bundle下，统一进行管理与调用。\n\n9. Project -\u003e Edit Scheme -\u003e Run -\u003e Build Configuration\n\n在Build Configuration选择Release，通过快捷键command+R 或者 command+B 和选择真机或模拟器输出Release版本SDK。然后在Products右击Show in Finder找到SDK。\n\n10. 合并库和查看库信息\n\n- 查看架构：使用 lipo -info 查看可执行文件(.a  .framework)架构。\n\n```\n# For frameworks.\nlipo -info ExamSimpleSdk.framework/ExamSimpleSdk\n\n# For static libraries.\nlipo -info xxx.a\n```\n\n- 合并架构：使用 lipo -create  模拟器可执行文件绝对路径  真机可执行文件绝对路径  -output  输出目录/可执行文件。\n\n```\n# For frameworks. After the command is executed, replace the executable file in the original library.\nlipo -create /Users/xxx/Library/Developer/Xcode/DerivedData/dgfkluumuexoxhcapzidtsmdgqcj/Build/Products/Release-iphonesimulator/ExamSimpleSdk.framework/ExamSimpleSdk /Users/xxx/Library/Developer/Xcode/DerivedData/dgfkluumuexoxhcapzidtsmdgqcj/Build/Products/Release-iphoneos/ExamSimpleSdk.framework/ExamSimpleSdk -output /Users/xxx/Desktop/ExamSimpleSdk \n\n# For static libraries. After the command is executed, replace the executable file in the original library.\nlipo -create /Users/xxx/Library/Developer/Xcode/DerivedData/dgfkluumuexoxhcapzidtsmdgqcj/Build/Products/Release-iphonesimulator/xxx.a /Users/xxx/Library/Developer/Xcode/DerivedData/dgfkluumuexoxhcapzidtsmdgqcj/Build/Products/Release-iphoneos/xxx.a -output /Users/xxx/Desktop/xxx.a \n```\n\n- 移除架构\n\n```\n# For frameworks. After the command is executed, replace the executable file in the original library.\nlipo -remove x86_64 ExamSimpleSdk.framework/ExamSimpleSdk -output ExamSimpleSdk.framework/ExamSimpleSdk\n\n# For static libraries. After the command is executed, replace the executable file in the original library.\nlipo -remove armv7s xxx.a -output xxx.a\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitenfay%2Fios-sdk-dev-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitenfay%2Fios-sdk-dev-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitenfay%2Fios-sdk-dev-demo/lists"}