
JSPatch
Lets iOS apps run JavaScript that calls and replaces Objective-C code, mainly for hotfixes.
- Stars
- 11.3k
- Forks
- 2.2k
- Licence
- MIT
- Language
- Objective-C
- Last update
- 5.9 years ago
- Type
- Library
No commits in over a year — check for forks or alternatives before adopting.
What it is
JSPatch is a small engine for iOS apps that connects Objective-C and JavaScript through the Objective-C runtime. Once the engine is included, JavaScript can call any Objective-C class and method, and can replace existing Objective-C methods. The README says it is mainly used to fix bugs in a shipped iOS app without a full App Store update.
- Replace a buggy Objective-C method at runtime by writing a defineClass script in JavaScript
- Call Objective-C APIs such as UIAlertView from a JavaScript file run by the engine
- Load a JavaScript file from the app bundle or the network and evaluate it with JPEngine
Great for
- iOS developers who want to patch a live app's Objective-C code without resubmitting
- Teams studying how Objective-C runtime bridging to JavaScript works
- Developers maintaining older iOS codebases that already use CocoaPods or manual integration
Not ideal for
- Apps targeting current iOS releases, since the README lists support only up to iOS 7+ and does not confirm newer platform support
- Teams that need App Store-compliant hotfixing, because the README asks developers to use the JSPatch platform instead of integrating it directly and links an FAQ about Apple policy
- Non-iOS developers, since the project is Objective-C and targets iOS
How to get it
- 1
Install with a package manager
You'll need: Xcode · CocoaPods (or manual file copy) · iOS 7+ target
Add to Podfile, then run pod install
pod 'JSPatch' - 2
Run it
- Add pod 'JSPatch' to your Podfile and install it with CocoaPods, or copy JSEngine.m, JSEngine.h and JSPatch.js into your project.
- Import JPEngine.h in your AppDelegate.
- Call [JPEngine startEngine] in application:didFinishLaunchingWithOptions:.
- Run a short script with [JPEngine evaluateScript:@"..."] to confirm the bridge works.
- 3
Get the most out of it
- Use block("...", function(){}) to pass blocks from JavaScript to Objective-C methods.
- Use self.ORIGmethodName() inside defineClass to call the original method before changing behavior.
- Add extensions such as JPInclude or JPCGTransform with [JPEngine addExtensions:] to support include() and CGAffineTransform.
- Read the project wiki for full documentation on base usage and defineClass.
Downloads
Strengths
- Small engine that uses the built-in JavaScriptCore framework
- Can call any Objective-C class and method by name from JavaScript
- Simple integration through CocoaPods or by copying three files
Trade-offs
- The README says the project is still in development and gives no recent release information
- Its own README asks developers to use the hosted JSPatch platform for safety and control, which limits direct self-hosting
- Targets old iOS versions and armv7 or arm64 architectures, so modern toolchain support is unclear
How it compares
| Project | Stars | Type | Level | Updated | Best for |
|---|---|---|---|---|---|
| JSPatch (this) | 11.3k | Library | advanced | 5.9 years ago | iOS developers who want to patch a live app's Objective-C code without resubmitting |
| react-native | 127k | Framework | intermediate | 4 days ago | Web developers who already know React and want to build mobile apps |
Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.