{"id":25312993,"url":"https://github.com/geekbrother/pod-patch","last_synced_at":"2025-07-21T11:05:54.511Z","repository":{"id":42991465,"uuid":"411451442","full_name":"geekbrother/pod-patch","owner":"geekbrother","description":"Patching the Cocoa Pod specfiles in ReactNative projects.","archived":false,"fork":false,"pushed_at":"2023-04-20T12:17:57.000Z","size":18,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-06-18T02:17:29.901Z","etag":null,"topics":["cocoapods","patch","patching","podspec","react-native"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/geekbrother.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}},"created_at":"2021-09-28T22:06:11.000Z","updated_at":"2024-10-07T07:36:40.000Z","dependencies_parsed_at":"2025-02-13T15:46:53.850Z","dependency_job_id":null,"html_url":"https://github.com/geekbrother/pod-patch","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/geekbrother/pod-patch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geekbrother%2Fpod-patch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geekbrother%2Fpod-patch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geekbrother%2Fpod-patch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geekbrother%2Fpod-patch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/geekbrother","download_url":"https://codeload.github.com/geekbrother/pod-patch/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geekbrother%2Fpod-patch/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265904360,"owners_count":23846678,"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":["cocoapods","patch","patching","podspec","react-native"],"created_at":"2025-02-13T15:35:26.662Z","updated_at":"2025-07-21T11:05:54.490Z","avatar_url":"https://github.com/geekbrother.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 💊 pod-patch [![npm version](https://badge.fury.io/js/pod-patch.svg)](https://badge.fury.io/js/pod-patch)\n\nPatching the Pods `podspec` files in **React Native** projects with the version tracking and `Podfile` updates.\n\n# Why\n\nWhen developing something using Cocoapods packages in some cases you need to modify the Pod's `podspec` file. Often these cases are:\n\n- Change the Pod dependency,\n- Modify compilation flags, paths, parameters,\n- Using the Pod with connected sources or libraries from another Pod.\n\nYou can do it by hand, download `podspec` file, modify, it and point to the local `podspec` file at the main **Podfile**. But what if I say:\n\n- That you need to patch a few Pods?\n- Their versions are changing too?\n- What if there are a bunch of the patched Pods with the different versions?\n\nHow not forget what and where was patched and patch them on the new versions or Podfile changes?\n\n**🎈 This small tool was created to solve this!**\n\n# Configuration\n\n### This tool is created for use in the **React Native** project.\n\nAs this tool doesn't require many parameters we are using the **convention over configuration** approach.\n\nBy default tool will look into the `native/ios/pod-patch` directory for the `.patch` files. The file name itself tells the tool which Pod and which version you want to patch the Pod's `podspec` and use it in your main Podfile.\n\nThe naming convention for the `.patch` files is `podName@version.patch` where `podName` is the name of the Pod and `version` is the Pod version to use for the patch apply.\n\nFor example, `native/ios/pod-patch/gRPC-Core@1.40.0.patch` will tell that we want to apply patch from this file to the `gRPC-Core` podspec file for the `1.40.0` version.\n\nAlso, you can use it without a version. When using `native/ios/pod-patch/gRPC-Core.patch` tool will apply the patch from this file to the `gRPC-Core` pod with the version from your Podfile. When using without a version you need to have a record in the Podfile with the pod and version.\n\nFor example:\n\n```ruby\ntarget 'App' do\n    ...\n    pod 'gRPC-Core', '1.40.0'\n```\n\nYou can have as many `.patch` files as you need, the tool will use all of them.\n\n# Running\n\nThe tool can be executed as the `npx pod-patch` command in the `native` directory of your **React Native** project.\n\nWhen running the tool will iterate through your `.patch` files checks if anything has changed and made some magic:\n\n- Checks if there is no version conflicts in your `Podfile` and `.patch` file,\n- Download a `podspec` file for your Pod from the [cocoapods git repo](https://github.com/CocoaPods/Specs/tree/master/Specs) to the `native/ios/pod-patch/.patched/{pod-name}/{pod-version}/` directory,\n- Apply the patch from the `.patch` file to it,\n- Changes the record for the patched **Pod** in the `Podfile` to point it to the local patched podspec. For example, the record for the `gRPC-Core` will automatically change to:\n\n```ruby\ntarget 'App' do\n    ...\n    pod 'gRPC-Core', :podspec =\u003e './pod-patch/.patched/gRPC-Core/1.40.0/gRPC-Core.podspec.json'\n```\n\nThe tool checks if the Pod is already patched.\nIf nothing changed from the already applied patches - it will do nothing.\n\n[![asciicast](https://asciinema.org/a/t77IAxPy1ZEZ84MAesfE4K2Bv.svg)](https://asciinema.org/a/t77IAxPy1ZEZ84MAesfE4K2Bv)\n\n## Using with the `yarn` or `npm i`\n\nA good practice is to use it linked with the running of `yarn` or `npm i` in the `native` directory in your install script in the `package.json` before the `pod install` execution.\n\nThis will updates/install the packages with the transparent checking if all of the Pod patches are up-to-date or need to be applied if something in the `.patch` file changed or `Podspec` has new changes in the pod dependency or version changes before the `pod install`.\n\nIf using this way with the `git` repo you can add `native/ios/pod-patch/.patched` directory to your `.gitignore`. Because when the tool runs it will check the existence of the local patched podspec files and create those that not exists.\n\n# Pod version changing\n\nIn case when the Pod version changed but you already have a `.patch` file for the previous version and it is already applied, but you want to upgrade the Pod and patch to the new version there are three simple steps:\n\n**First**, if your `.patch` file in the `native/ios/pod-patch` has a version format i.e. `gRPC-Core@1.40.0.patch` you need to create a patch file for the new version i.e. `gRPC-Core@1.41.0.patch`.\n\nIf the `.patch` file in the no-version format i.e. `gRPC-Core.patch` you do nothing here as this is an universal patch for all versions.\n\n**Second**, you need to point to the new version of the Pod in your `Podfile`. For example, upgrading to 1.41.0, need to look like:\n\n```ruby\ntarget 'App' do\n    ...\n    pod 'gRPC-Core', '1.41.0'\n```\n\n**Third**, you need to run `npx pod-patch` from your `native` directory and the tool will create a new patched Pod and point Podfile to it 🙌.\n\nIf you have a version-agnostic `.patch` file, actually you only need to do a second step only (point to the new version at the Podfile) and just run the tool!\n\n# Command line flags\n\n- `-h`: Output the command usage help.\n- `-v`: Output the script version.\n- `-p`: Path to the directory where the `.patch` files are if it differs from the default `native/ios/pod-patch`.\n- `-d`: Path to the `Podfile` if it differs from the default `native/ios/Podfile`.\n\n# Todo\n\n- [ ] Resolving conflicts if there are a few patch files for one Pod present.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeekbrother%2Fpod-patch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeekbrother%2Fpod-patch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeekbrother%2Fpod-patch/lists"}