baidu-maps/ios-sdk-skills/ios-empty-project
Claude Code and agent skill by baidu-maps/ios-sdk-skills
- community
Checking that the SKILL.md file is still in the repository.
Creates minimal iOS project structure from scratch. Must directly generate .xcodeproj (project.pbxproj) so the project can be opened in Xcode without XcodeGen. Supports Swift (SwiftUI/UIKit) and Objective-C (UIKit). Use when the user wants to create an iOS empty project, start a new iOS app, scaffold iOS app structure, or mentions iOS 空工程. Optimized for Baidu Map SDK integration (Info.plist CFBundleDisplayName, AppDelegate placeholder).
Install
npx vskill@latest install baidu-maps/ios-sdk-skills/ios-empty-projectSKILL.md
iOS 空工程
从零搭建最小化 iOS 项目结构,支持 SwiftUI、UIKit(Swift/OC),纯代码无 Storyboard。空工程创建时必须直接生成 .xcodeproj,使工程可直接用 Xcode 打开,不依赖用户本机安装 XcodeGen。
Agent 执行要求(必读)
创建 iOS 空工程时必须同时完成:
- 生成源码与资源:在
{ProjectName}/{ProjectName}/下创建对应模板的源码文件(main/AppDelegate/SceneDelegate/ViewController、Info.plist 等)。UIKit 工程(Swift/OC)必须包含 LaunchScreen.storyboard,否则在刘海屏设备上会出现非全屏(黑边)。 - 直接生成 .xcodeproj:在工程根目录(与内层
{ProjectName}/同级)创建 `{ProjectName}.xcodeproj/project.pbxproj`,内容为合法 Xcode 工程格式,包含:
- PBXBuildFile:每个需参与编译的 .m 或 .swift 一条;UIKit 工程必须包含 LaunchScreen.storyboard 的 Resources BuildFile。
- PBXFileReference:每个文件(含 .h、.m/.swift、Info.plist、.app)一条;UIKit 工程含 LaunchScreen.storyboard;product 的 explicitFileType 为
wrapper.application,path 为{ProjectName}.app。 - PBXGroup:根 Group、Products、以及源码目录 Group(path =
{ProjectName}),子 Group 按需(如 Models、Views 等);源码 Group 中需包含 LaunchScreen.storyboard。 - PBXSourcesBuildPhase:列出所有 .m 或 .swift 的 BuildFile。
- PBXFrameworksBuildPhase:可为空 files。
- PBXResourcesBuildPhase:UIKit 工程必须包含 LaunchScreen.storyboard 的 BuildFile;若含 Assets.xcassets 则再加入对应 BuildFile。
- PBXNativeTarget:buildPhases 含 Sources、Frameworks、Resources;productReference 指向 .app 的 FileReference;productName = ProjectName。
- PBXProject:rootObject;mainGroup;targets 含上述 NativeTarget。
- XCBuildConfiguration(Project 与 Target 各 Debug/Release):
IPHONEOS_DEPLOYMENT_TARGET = 15.0;INFOPLIST_FILE = {ProjectName}/Info.plist;PRODUCT_BUNDLE_IDENTIFIER = com.example.{ProjectName};TARGETED_DEVICE_FAMILY = "1,2";GENERATE_INFOPLIST_FILE = NO(使用自定义 Info.plist 时)。 Swift 时加 SWIFT_VERSION = "5.0"。不要引用不存在的 Asset Catalog(如无 Assets 则不写 ASSETCATALOG_COMPILER_*)。
- 目录约定:工程根目录结构为
{ProjectName}/{ProjectName}.xcodeproj/与{ProjectName}/{ProjectName}/(源码目录),pbxproj 中 Group 的 path 与相对路径与此一致。
完成后用户可直接 `open {ProjectName}.xcodeproj` 编译运行,无需执行 xcodegen generate。
(若用户明确要求使用 XcodeGen,可额外提供 project.yml 并说明需本地执行 xcodegen generate;否则以直接生成 .xcodeproj 为准。)
可选:使用 XcodeGen 生成项目
若用户已安装 XcodeGen 或明确要求用 YAML 维护工程,可提供 project.yml,由用户在工程根目录执行 xcodegen generate 生成 .xcodeproj。
- 安装 XcodeGen:
brew install xcodegen(或 Mint:mint install yonaskolb/XcodeGen) - 创建工程目录:如
MyApp/,其下建子目录MyApp/作为 target 源码目录 - 在工程根目录(与
MyApp/同级)创建 `project.yml`,按模板选择其一(见下) - 将对应模板的源码文件放入
MyApp/MyApp/(及 Assets.xcassets) - 执行:在含
project.yml的目录运行xcodegen generate,生成MyApp.xcodeproj - 打开:
open MyApp.xcodeproj
project.yml 示例(SwiftUI)
工程根目录放 project.yml,target 源码目录为 MyApp:
project.yml 示例(UIKit Swift,纯代码)
需在 MyApp/Info.plist 中补全或仅保留 Scene 相关键时,也可将 info.path 指向该 plist,由 XcodeGen 自动设置 INFOPLIST_FILE。UIKit 工程仍需在 `MyApp/MyApp/` 下创建 `LaunchScreen.storyboard` 并纳入 sources/resources,否则刘海屏上非全屏。
project.yml 示例(UIKit Objective-C,纯代码)
OC 工程 UISceneDelegateClassName 填 SceneDelegate(不要用 $(PRODUCT_MODULE_NAME).SceneDelegate),否则运行可能报错。同样需提供 `LaunchScreen.storyboard`。
选择模板
创建前请让开发者选择:Swift 还是 Objective-C?
| 语言 | 类型 | 适用场景 | |
|---|---|---|---|
| Swift | SwiftUI | 新项目首选,声明式 UI,代码量少 | |
| Swift | UIKit | 纯代码无 Storyboard | |
| Objective-C | UIKit | 维护老项目、接入 OC 第三方库、团队偏好 OC |
SwiftUI 空工程(Swift)
以下源码与资源与上文 project.yml(SwiftUI) 配合使用:放入 MyApp/MyApp/ 及 MyApp/MyApp/Assets.xcassets/,再执行 xcodegen generate。也可仅用 Xcode 手动创建。
目录结构
1. App 入口 MyAppApp.swift
2. 根视图 ContentView.swift
3. Assets.xcassets
创建 Assets.xcassets 目录,内含 Contents.json:
UIKit 空工程(Swift,纯代码)
以下源码与 project.yml(UIKit Swift) 配合使用:源码放入 MyApp/MyApp/,Info.plist 可由 XcodeGen 的 info 生成或自建。
目录结构
1. AppDelegate.swift
2. SceneDelegate.swift
3. ViewController.swift
4. LaunchScreen.storyboard(必须)
UIKit 工程必须包含启动图,否则在 iPhone X 及以后机型上会以兼容模式显示,出现上下/左右黑边(非全屏)。在 MyApp/MyApp/ 下创建 LaunchScreen.storyboard,内容可为:
并在 Info.plist 中增加:
pbxproj 中需:PBXFileReference(LaunchScreen.storyboard)、PBXGroup 中加入该文件、PBXBuildFile 加入 Resources、PBXResourcesBuildPhase 的 files 中加入该 BuildFile。
5. Info.plist(Scene 配置)
在 Info.plist 中需包含(UILaunchStoryboardName 见上一节)。使用自定义 Info.plist 且 GENERATE_INFOPLIST_FILE = NO 时,必须包含 CFBundleExecutable,否则真机安装会报「missing or invalid CFBundleExecutable」:
若集成百度地图且使用定位,需添加 NSLocationWhenInUseUsageDescription。
UIKit 空工程(Objective-C,纯代码)
以下源码与 project.yml(UIKit OC) 配合使用:源码放入 MyApp/MyApp/,Info.plist 可由 XcodeGen 的 info 生成或自建。
目录结构
1. main.m
2. AppDelegate.h / AppDelegate.m
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/ios-empty-project/SKILL.md
Popularity
- Repository stars
- 1
- 7-day trend score
- 3
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/baidu-maps/ios-sdk-skills/ios-empty-project)