{"id":20263980,"url":"https://github.com/x140yu/debug_cocoapods_plugins_in_vscode","last_synced_at":"2025-08-31T23:34:55.192Z","repository":{"id":36448712,"uuid":"202146091","full_name":"X140Yu/debug_cocoapods_plugins_in_vscode","owner":"X140Yu","description":null,"archived":false,"fork":false,"pushed_at":"2024-03-01T16:52:37.000Z","size":2767,"stargazers_count":67,"open_issues_count":10,"forks_count":14,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-02T01:24:14.448Z","etag":null,"topics":["cocoapods","cocoapods-plugin","debugging-cocoapods","vscode"],"latest_commit_sha":null,"homepage":"https://zxy.vercel.app/debug-cocoapods-with-vscode","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/X140Yu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2019-08-13T13:03:38.000Z","updated_at":"2024-11-15T11:24:40.000Z","dependencies_parsed_at":"2025-04-11T02:09:36.444Z","dependency_job_id":"4cda7aaf-f04f-4f4d-8ce9-6aeafb90db9c","html_url":"https://github.com/X140Yu/debug_cocoapods_plugins_in_vscode","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/X140Yu/debug_cocoapods_plugins_in_vscode","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/X140Yu%2Fdebug_cocoapods_plugins_in_vscode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/X140Yu%2Fdebug_cocoapods_plugins_in_vscode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/X140Yu%2Fdebug_cocoapods_plugins_in_vscode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/X140Yu%2Fdebug_cocoapods_plugins_in_vscode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/X140Yu","download_url":"https://codeload.github.com/X140Yu/debug_cocoapods_plugins_in_vscode/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/X140Yu%2Fdebug_cocoapods_plugins_in_vscode/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273053508,"owners_count":25037424,"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","status":"online","status_checked_at":"2025-08-31T02:00:09.071Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cocoapods","cocoapods-plugin","debugging-cocoapods","vscode"],"created_at":"2024-11-14T11:37:03.513Z","updated_at":"2025-08-31T23:34:55.161Z","avatar_url":"https://github.com/X140Yu.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Debug CocoaPods \u0026 Plugins in VSCode\n\n[中文版本点这里](./duwo.md)\n\n[使用 VSCode debug CocoaPods 和插件源码](https://zxy.vercel.app/debug-cocoapods-with-vscode)\n\n![Debug cocoapods](img/1.png)\n\n![Debug plugin](img/2.png)\n\n- [Debug CocoaPods \u0026 Plugins in VSCode](#debug-cocoapods--plugins-in-vscode)\n  - [Pre-requirements](#pre-requirements)\n    - [Install Debug Gems](#install-debug-gems)\n    - [Install VSCode Ruby Plugin](#install-vscode-ruby-plugin)\n  - [Debug With bundler](#debug-with-bundler)\n  - [Debug without bundler](#debug-without-bundler)\n    - [Debug CocoaPods](#debug-cocoapods)\n    - [Debug CocoaPods \u0026 plugin](#debug-cocoapods--plugin)\n    - [Example of debugging CocoaPods \u0026 plugin](#example-of-debugging-cocoapods--plugin)\n\n## Pre-requirements\n\n### Install Debug Gems\n\n```sh\ngem install ruby-debug-ide\ngem install debase\n```\n\n### Install VSCode Ruby Plugin\n\n[Ruby](https://marketplace.visualstudio.com/items?itemName=rebornix.Ruby)\n\n## Debug With bundler\n\n- Create a `Gemfile` in project root and add the following content to it\n\n```rb\ngem 'cocoapods', path: 'path/to/cocoapods/'\ngem 'cocoapods-binary', path: 'path/to/cocoapods-binary/'\ngem 'ruby-debug-ide'\ngem 'debase'\n```\n\n- run `bundle install`\n- Create `.vscode/launch.json` in project root\n\n```json\n{\n  \"configurations\": [{\n      \"name\": \"Debug CocoaPods Plugin with Bundler\",\n      \"showDebuggerOutput\": true,\n      \"type\": \"Ruby\",\n      \"request\": \"launch\",\n      \"useBundler\": true,\n      \"cwd\": \"${workspaceRoot}/Testing\",\n      \"program\": \"${workspaceRoot}/cocoapods/bin/pod\",\n      \"args\": [\"install\"]\n    }\n}\n```\n\n- Add some breakpoint within VSCode\n- Press F5 or hit menu `Debug - Start Debugging`\n\n\n## Debug without bundler\n\n\u003e Don't waste your time! Use bundler now!\n\n### Debug CocoaPods\n\n- Clone [CocoaPods](https://github.com/CocoaPods/CocoaPods)\n```sh\ngit clone https://github.com/CocoaPods/CocoaPods.git\n```\n\n- Checkout cloned repo to match the version you have installed on your laptop\n\n```sh\ngit checkout `pod --version`\n```\n\n- Create `.vscode/launch.json` in CocoaPods' root folder\n\n```json\n{\n  \"configurations\": [{\n    \"name\": \"Debug CocoaPods Plugin\",\n    \"showDebuggerOutput\": true,\n    \"type\": \"Ruby\",\n    \"request\": \"launch\",\n    \"cwd\": \"path/to/podfile/dir\", // where the `pod` command execute (the folder should contain a `Podfile`)\n    \"program\": \"${workspaceRoot}/bin/pod\",\n    \"args\": [\"install\"] // `pod` command arguments\n  }]\n}\n```\n- Comment `bin/pod:L27 (# require 'bundler/setup')` \n- Add some breakpoint within VSCode\n- Press F5 or hit menu `Debug - Start Debugging`\n\n### Debug CocoaPods \u0026 plugin\n\n- Create a new folder, all actions below are under this folder\n- Clone \u0026 checkout CocoaPods source code\n- Clone or create a CocoaPods plugin\n- Copy `.vscode` to this folder\n- Make some changes in `.vscode/launch.json`\n  - `cwd`: where the `pod` command execute (the folder should contain a `Podfile`) \n  - `pluginPath`: path to the plugin\n  - `args`: `pod` command arguments\n- Change `cocoapods/bin/pod:L27` \n  - From `require 'bundler/setup` to `require_relative '../../.vscode/plugin_patch'`, just like [this](https://github.com/X140Yu/debug_cocoapods_plugins_in_vscode/blob/1a79aa6db45b67218e84044d8c3dce665cf92658/cocoapods/bin/pod#L27:L28)\n- Add some breakpoint within VSCode\n- Press F5 or hit menu `Debug - Start Debugging` \n\n### Example of debugging CocoaPods \u0026 plugin\n\n\u003e The CocoaPods version in this repository is `1.8.0.beta.1`, incase some version incompatible issue with CocoaPods-Core or other gems, you should install this version's CocoaPods in your Mac too\n\n- Clone this repository\n- Open it with VSCode\n- Add a breakpoint somewhere you like to explore\n  - eg. `cocoapods/lib/cocoapods/command/install.rb:L46`\n  - eg. `cocoapods-binary/lib/cocoapods-binary/Main.rb:L101`\n- Press F5 or hit menu `Debug - Start Debugging`\n- All set 🌸\n\n\n---\n\nIf you have any question, don't hesitate to fire a issue 😉\n\nAppreciate a 🌟 if you like it. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fx140yu%2Fdebug_cocoapods_plugins_in_vscode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fx140yu%2Fdebug_cocoapods_plugins_in_vscode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fx140yu%2Fdebug_cocoapods_plugins_in_vscode/lists"}