Posts

Showing posts with the label macOS

A New Collection of Thoughtful Learning Apps — Now Available on iOS & Android

Image
I’m excited to share a set of mobile apps I’ve recently completed and published on both the Google Play Store and the Apple App Store. These apps are designed with a simple goal in mind: to make meaningful, structured content more accessible, whether you’re studying theology or improving your English vocabulary. 📱 Now Available on Both Platforms All apps are live and available for download: Google Play Developer Page: https://play.google.com/store/apps/dev?id=5835943159853189043 Apple App Store Developer Page: https://apps.apple.com/ca/developer/q-z-l-corp/id1888794100 📖 Theology & Confession Study Apps For those interested in Reformed theology and classical Christian teachings, I’ve developed a series of apps that present foundational texts in a clean, focused reading format: The Belgic Confession Canons of Dort Heidelberg Catechism Westminster Shorter Catechism Each app is designed to provide a distraction-free experience, making it easier to read, reflect, and revisit these im...

解决 Xcode 报错:Sandbox rsync “Operation not permitted”(React Native / CocoaPods 完整方案)

Image
解决 Xcode 报错:Sandbox rsync “Operation not permitted”(React Native / CocoaPods) 在使用 React Native 开发 iOS 应用时,如果你在 Xcode 中遇到类似如下错误: Sandbox: rsync deny(1) file-read-data Operation not permitted PhaseScriptExecution [CP] Embed Pods Frameworks 那么你踩到了 Xcode 15+ 中一个非常常见的坑。 🔍 问题原因 Xcode 15 引入了更严格的安全机制 —— User Script Sandboxing(用户脚本沙箱) 。 这个机制会限制构建过程中脚本的文件访问权限,而 CocoaPods 在编译时会执行一个脚本(Embed Pods Frameworks),使用 rsync 来复制 framework: ❌ 无法读取 framework 文件(如 React.framework) ❌ 无法写入 app bundle 最终导致 Operation not permitted 错误。 ✅ 解决方案(最有效) 关闭 Xcode 的 User Script Sandboxing : 打开 Xcode 选择你的 Project(不是 Target) 进入 Build Settings 搜索: User Script Sandboxing 将其设置为: NO 然后执行清理并重新编译: Shift + Command + K 通常问题会立刻解决。 💡 原理说明 关闭脚本沙箱后,CocoaPods 的构建脚本将可以正常执行: 读取 framework 文件 复制到应用目录 保留签名信息(CodeSignature) ⚠️ 如果仍然报错(补充方案) 可以尝试以下操作: 给 Xcode 添加 Full Disk Access(完整磁盘权限) 删除 DerivedData 目录 重新执行 pod install 🚀 总结 这个问题并不是你的项目配置错误,而是: Xcode ...

Fix Xcode Sandbox rsync “Operation not permitted” Error (React Native / CocoaPods Solution)

Image
Fix Xcode Sandbox rsync “Operation not permitted” Error (React Native / CocoaPods) If you are building a React Native iOS app and suddenly see errors like: Sandbox: rsync deny(1) file-read-data Operation not permitted PhaseScriptExecution [CP] Embed Pods Frameworks You are not alone. This issue is very common in Xcode 15+ due to stricter sandboxing rules. 🔍 Root Cause Xcode introduced User Script Sandboxing , which restricts scripts (like CocoaPods' framework embedding step) from accessing certain files. During build, rsync is used to copy frameworks (e.g. React.framework), but the sandbox blocks it: ❌ Cannot read framework files ❌ Cannot write into app bundle This results in the infamous Operation not permitted error. ✅ Solution (Works Instantly) Disable User Script Sandboxing in Xcode: Open your project in Xcode Select the project (not target) Go to Build Settings Search for: User Script Sandboxing Set it to: NO Then clean and r...

我们如何为 macOS 应用添加国际化和多语言支持

Image
我们如何为 macOS 应用添加国际化和多语言支持 支持多语言对于拓展全球用户至关重要。本文将以我们的 macOS 应用 iTrans 为例,介绍我们如何通过 Swift 和 Xcode 实现国际化(i18n)和中文本地化。 1. 审查所有用户可见文本 第一步是查找代码中所有用户可见的字符串。我们在 SwiftUI 视图、模型和操作符中搜索所有硬编码文本。 2. 提取待本地化字符串 我们将所有硬编码字符串替换为支持本地化的 API: 在 SwiftUI 中, Text 视图使用 LocalizedStringKey 。 其他字符串使用 NSLocalizedString 。 Text(LocalizedStringKey("Unlock your iPhone")) // 或 NSLocalizedString("Untitled", comment: "File with no name") 3. 创建本地化文件 我们为每种支持的语言创建了 Localizable.strings 文件: en.lproj/Localizable.strings —— 英文 zh-Hans.lproj/Localizable.strings —— 简体中文 每个文件都包含所有用户可见文本的键值对。 英文示例: "Unlock your iPhone" = "Unlock your iPhone"; 中文示例: "Unlock your iPhone" = "解锁你的 iPhone"; 4. 将本地化文件添加到 Xcode 工程 为了让 Xcode 识别本地化文件: 我们通过项目导航器将 Localizable.strings 文件添加到工程。 在文件检查器中,启用本地化并勾选所有支持的语言。 5. 测试本地化效果 Xcode 让我们可以轻松测试不同语言下的应用效果: 在 Scheme 编辑器中,将应用语言设置为“简体中文”并运行应用。 我们还验证了所有界面文本在英文和中文下都能正确显示。 6. ...

How We Added Internationalization and Multi-Language Support to Our macOS App

Image
How We Added Internationalization and Multi-Language Support to Our macOS App   Supporting multiple languages is essential for reaching a global audience. In this post, we’ll walk through how we added internationalization (i18n) and Chinese localization to our macOS app, iTrans , using Swift and Xcode. 1. Audit All User-Facing Text The first step was to identify all user-facing strings in our codebase. We searched through our SwiftUI views, models, and operators for any hardcoded text that would be visible to users. 2. Extract Strings for Localization We replaced all hardcoded strings with localization-friendly APIs: For SwiftUI, we used LocalizedStringKey in Text views. For other strings, we used NSLocalizedString . Text(LocalizedStringKey("Unlock your iPhone")) // or NSLocalizedString("Untitled", comment: "File with no name") 3. Create Localization Files We created Localizable.strings files for each supported language: en.l...

How I Set Up My Local Environment to Run a React Native iOS App

Image
How I Set Up My Local Environment to Run a React Native iOS App Setting up a React Native project for iOS locally sounds simple—until you hit the usual roadblocks: Ruby versions, CocoaPods issues, Xcode configuration, and mysterious build failures. Here’s a clean, real-world setup that actually works. 🍎 Step 0 — Prepare Xcode (Critical but Easy to Miss) Even if you already installed Xcode from the App Store, your system may not be fully configured for command-line builds. I ran into issues until I completed these steps: 1. Select the Correct Xcode Path sudo xcode-select -s /Applications/Xcode.app/Contents/Developer xcode-select -p Expected output: /Applications/Xcode.app/Contents/Developer 2. Accept the Xcode License sudo xcodebuild -license Then: Press space to scroll through the license Type agree at the end Without this, builds may fail silently or with confusing errors. 3. Install Command Line Tools (if not already) xcode-select --install React Native i...

GitHub Copilot MCP 服务器 OAuth 认证问题 - 完美解决!

Image
GitHub Copilot MCP 服务器 OAuth 认证问题 - 完美解决! 问题描述 如果你在 VS Code 中看到这个错误: ● MCP Server: github-mcp-server Type: http URL: https://api.individual.githubcopilot.com/mcp/readonly Status: ✗ Failed Error: OAuth authentication failed for github-mcp-server 你不是一个人。这个令人沮丧的错误会导致 Copilot 的高级功能不可用,即使你已经登录了 VS Code。 根本原因 这个问题源于你的 ~/.copilot/mcp-config.json 文件。如果你手动创建或编辑过这个配置文件,但没有包含 OAuth 令牌,MCP 服务器将无法进行身份验证。 以下是一个有问题的配置示例: { "mcpServers": { "github-mcp-server": { "type": "http", "url": "https://api.individual.githubcopilot.com/mcp/readonly" } } } 看到缺失的身份验证凭据了吗?那就是罪魁祸首。 最简单的解决方案(推荐) 只需删除 mcp-config.json 文件: rm ~/.copilot/mcp-config.json 然后: 打开 VS Code 如果还没有登录,请登录 GitHub Copilot 关闭并重新打开 VS Code,或重新加载窗口 就这样!当你登录时,VS Code 会自动使用正确的 OAuth 身份验证创建正确的配置。 做完这些后,你应该会看到: ...

GitHub Copilot MCP Server OAuth Authentication Issue - Solved!

Image
GitHub Copilot MCP Server OAuth Authentication Issue - Solved! The Problem If you're seeing this error in VS Code: ● MCP Server: github-mcp-server Type: http URL: https://api.individual.githubcopilot.com/mcp/readonly Status: ✗ Failed Error: OAuth authentication failed for github-mcp-server You're not alone. This frustrating error can make Copilot's advanced features unavailable, even though you're signed into VS Code. Root Cause The issue stems from your ~/.copilot/mcp-config.json file. If you have manually created or edited this configuration file without including the OAuth token, the MCP server will fail to authenticate. Here's what a problematic config looks like: { "mcpServers": { "github-mcp-server": { "type": "http", "url": "https://api.individual.githubcopilot.com/mcp/readonly" } } } Notice the ...

我如何修复了 macOS 上的 GitHub Copilot CLI 连接问题

Image
我如何修复了 macOS 上的 GitHub Copilot CLI 连接问题 问题描述 我遇到了一个令人沮丧的问题。GitHub Copilot 在 VS Code 的聊天窗口中运行良好,但是 gh copilot CLI 命令会无限期地挂起,没有任何输出。所有命令,如 gh copilot -p "what is 2+2" 都会冻结,使 CLI 无法使用。 初始症状 ✅ GitHub Copilot 在 VS Code 中聊天功能工作正常 ✅ GitHub CLI ( gh ) 已安装并已通过身份验证 ✅ 令牌具有正确的 copilot 作用域 ❌ 任何 gh copilot 命令都会挂起并超时 ❌ 命令似乎连接但从不返回结果 诊断过程 步骤1:验证身份验证 首先,我检查了 GitHub CLI 是否已正确通过身份验证: gh auth status 输出显示我已使用 copilot 作用域登录: github.com ✓ 已登录账户 qzl-dev (keyring) - 令牌作用域:'admin:public_key', 'copilot', 'gist', 'read:org', 'repo' 身份验证不是问题。 步骤2:检查 Copilot CLI 安装 gh copilot --version CLI 已安装(版本 0.0.422),所以这也不是问题。 步骤3:查看日志 这是我发现问题的地方。我检查了 Copilot CLI 日志: cat ~/.copilot/logs/*.log | tail -50 日志显示了真正的问题: [ERROR] 发出 GitHub API 请求时出错:Error: unable to get issuer certificate; if the root CA is installed locally, try running Node.js with --use-system-ca [ERROR] 无法启动远程服务器 github-mcp-server 的 MCP 客户端: TypeError: fetch ...

How I Fixed GitHub Copilot CLI Connection Issues on macOS

Image
How I Fixed GitHub Copilot CLI Connection Issues on macOS The Problem I encountered a frustrating issue where GitHub Copilot worked perfectly in VS Code's chat window, but the gh copilot CLI command would hang indefinitely without producing any output. All commands like gh copilot -p "what is 2+2" would just freeze, making the CLI unusable. Initial Symptoms ✅ GitHub Copilot chat in VS Code worked fine ✅ GitHub CLI ( gh ) was installed and authenticated ✅ Token had the correct copilot scope ❌ Any gh copilot command would hang and timeout ❌ Commands appeared to connect but never returned results Diagnostic Process Step 1: Verify Authentication First, I checked that my GitHub CLI was properly authenticated: gh auth status Output showed I was logged in with the copilot scope included: github.com ✓ Logged in to github.com account qzl-dev (keyring) - Token scopes: 'admin:public_key', 'copilot', 'gist', 'read:org...

iTrans – Fast iPhone Photo & Video Transfer for macOS

Image
iTrans – Fast iPhone Photo & Video Transfer for macOS Do you find Photos.app slow or cluttered when backing up your iPhone photos and videos to your Mac? I built iTrans , a lightweight macOS utility that lets you transfer your media directly into folders on your Mac — fast, simple, and without the extra bloat. How iTrans Works Plug in your iPhone Open iTrans Select photos and videos to transfer Choose the destination folder on your Mac Click transfer — done! iTrans is perfect for quick media backups, organizing photos without importing them into Photos.app, or simply moving videos off your iPhone in a flash. Demo Video Check out this short demo showing iTrans in action: Support iTrans To publish iTrans on the Mac App Store, Apple requires a $99 annual Apple Developer Program fee. If you find iTrans useful and want to support its release, you can contribute here: Support iTrans – Help Publish on the Mac App Store Even if you can't contrib...