🔎 An HTTP inspector for iOS & URLSession (like Charles but on device)
🔎 iOS & URLSession için HTTP inceleyici (Charles gibi ama cihazda)
ChuckerIOS is an iOS library that allows you to inspect and debug HTTP requests made by your app. It's inspired by the popular Chucker library for Android.
ChuckerIOS, uygulamanızın yaptığı HTTP isteklerini incelemenizi ve debug etmenizi sağlayan bir iOS kütüphanesidir. Android için popüler olan Chucker kütüphanesinden ilham alınmıştır.
✅ Working Features / Çalışan Özellikler:
- 📦 Core Library - HTTP transaction models and storage
- 🔧 Configuration System - Flexible configuration options
- 💾 Transaction Storage - In-memory storage with filtering
- 🔔 Notification Manager - Local notifications (basic)
- 🌐 Cross-Platform Support - Works on iOS and macOS
🚧 In Development / Geliştirme Aşamasında:
- 🎨 UI Components - Storyboard-based interface
- 🔄 Method Swizzling - Real URLSession interception
- 🎯 Floating Button - Quick access button
- 📱 Demo App - Complete example application
- 📱 Real-time HTTP monitoring - See all network requests as they happen
Gerçek zamanlı HTTP izleme - Tüm ağ isteklerini gerçekleştiği anda görün - 🔍 Detailed request/response inspection - View headers, body, timing, and more
Detaylı istek/yanıt inceleme - Başlıklar, gövde, zamanlama ve daha fazlasını görüntüleyin - 🔔 Push notifications - Get notified when new requests are made
Push bildirimleri - Yeni istekler yapıldığında bildirim alın - 🎯 Floating button - Quick access to the inspector
Yüzen buton - İnceleyiciye hızlı erişim - 🔍 Search & filter - Find specific requests easily
Arama ve filtreleme - Belirli istekleri kolayca bulun - 📤 Export & share - Share request details
Dışa aktarma ve paylaşma - İstek detaylarını paylaşın - 🔒 Header redaction - Hide sensitive information
Başlık gizleme - Hassas bilgileri gizleyin - 🎨 Beautiful UI - Clean, intuitive interface
Güzel arayüz - Temiz, sezgisel arayüz
- Xcode'da projenizi açın
- File > Add Package Dependencies menüsüne gidin
- Repository URL'ini girin:
https://github.com/erdncyz/ChuckerIOS.git - Add Package butonuna tıklayın
- Versiyonu seçin (genellikle en son stable version)
- Target'ınızı seçin ve Add Package butonuna tıklayın
Eğer Package.swift dosyanız varsa, dependencies bölümüne ekleyin:
dependencies: [
.package(url: "https://github.com/erdncyz/ChuckerIOS.git", from: "1.0.0")
],
targets: [
.target(
name: "YourApp",
dependencies: ["ChuckerIOS"]
)
]git clone https://github.com/erdncyz/ChuckerIOS.gitYöntem A: Drag & Drop
- ChuckerIOS klasörünü Xcode projenize sürükleyin
- "Copy items if needed" seçeneğini işaretleyin
- Target'ınızı seçin
- "Create groups" seçeneğini seçin
Yöntem B: Add Files
- Xcode'da projenize sağ tıklayın
- Add Files to "YourProject" seçin
- ChuckerIOS/Sources/ChuckerIOS klasörünü seçin
- "Copy items if needed" ve target'ınızı seçin
- ChuckerIOS.storyboard dosyasını projenize ekleyin
- Bundle'a dahil edildiğinden emin olun
Podfile'ınıza ekleyin:
pod 'ChuckerIOS', :git => 'https://github.com/erdncyz/ChuckerIOS.git'Sonra:
pod installCartfile'ınıza ekleyin:
github "erdncyz/ChuckerIOS"
Sonra:
carthage updateProjenizde ChuckerIOS'u kullanmak için önce import edin:
import ChuckerIOSUygulamanızın başlangıcında (AppDelegate veya SceneDelegate'de) ChuckerIOS'u yapılandırın:
// AppDelegate.swift veya SceneDelegate.swift
import ChuckerIOS
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// ChuckerIOS yapılandırması
let configuration = ChuckerConfiguration(
showNotifications: true, // Bildirimleri göster
redactHeaders: ["Authorization", "Cookie"], // Hassas header'ları gizle
maxTransactions: 1000, // Maksimum transaction sayısı
enableFloatingButton: true, // Floating button'u etkinleştir
notificationTitle: "Network Activity" // Bildirim başlığı
)
// ChuckerIOS'u yapılandır ve başlat
ChuckerIOS.shared.configure(with: configuration)
ChuckerIOS.shared.start()
return true
}ChuckerIOS UI'sını göstermek için:
// Herhangi bir ViewController'da
@IBAction func showNetworkInspector(_ sender: Any) {
ChuckerIOS.shared.show()
}
// Veya programmatik olarak
ChuckerIOS.shared.show()ChuckerIOS otomatik olarak tüm URLSession isteklerini yakalar:
// GET Request
let url = URL(string: "https://api.example.com/data")!
let task = URLSession.shared.dataTask(with: url) { data, response, error in
// Completion handler
if let data = data {
print("Data received: \(data)")
}
}
task.resume()
// POST Request
var request = URLRequest(url: URL(string: "https://api.example.com/post")!)
request.httpMethod = "POST"
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
let postData = ["key": "value"].data(using: .utf8)
request.httpBody = postData
let postTask = URLSession.shared.dataTask(with: request) { data, response, error in
// Handle response
}
postTask.resume()Floating button etkinleştirildiyse, otomatik olarak ekranın sağ alt köşesinde görünür ve tüm network aktivitelerini gösterir.
Bildirimler etkinleştirildiyse, her yeni network isteği için otomatik bildirim alırsınız.
let configuration = ChuckerConfiguration(
showNotifications: true, // Show notifications for new requests
redactHeaders: ["Authorization"], // Headers to redact (hide sensitive data)
maxTransactions: 1000, // Maximum number of requests to store
enableFloatingButton: true, // Show floating button for quick access
notificationTitle: "ChuckerIOS" // Custom notification title
)import ChuckerIOS
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// ChuckerIOS'u başlat (AppDelegate'de yapılandırıldıysa)
ChuckerIOS.shared.start()
// API isteği yap
makeAPIRequest()
}
private func makeAPIRequest() {
let url = URL(string: "https://jsonplaceholder.typicode.com/posts")!
let task = URLSession.shared.dataTask(with: url) { data, response, error in
DispatchQueue.main.async {
if let error = error {
print("Request failed: \(error.localizedDescription)")
} else {
print("Request completed successfully")
}
}
}
task.resume()
}
@IBAction func showInspector(_ sender: Any) {
ChuckerIOS.shared.show()
}
}// Özel yapılandırma
let configuration = ChuckerConfiguration(
showNotifications: true, // Bildirimleri göster
redactHeaders: ["Authorization", "Cookie", "X-API-Key"], // Hassas header'ları gizle
maxTransactions: 500, // Maksimum 500 transaction sakla
enableFloatingButton: true, // Floating button'u etkinleştir
notificationTitle: "My App Network" // Özel bildirim başlığı
)
ChuckerIOS.shared.configure(with: configuration)
ChuckerIOS.shared.start()// Tüm transaction'ları al
let transactions = ChuckerIOS.shared.getAllTransactions()
// Belirli URL'ye göre filtrele
let filteredTransactions = ChuckerIOS.shared.storage?.getTransactions(filteredBy: "api.example.com")
// Hata olan transaction'ları al
let errorTransactions = ChuckerIOS.shared.storage?.getErrorTransactions()
// Tüm transaction'ları temizle
ChuckerIOS.shared.clearTransactions()
// Monitoring'i durdur
ChuckerIOS.shared.stop()#if DEBUG
// Debug modunda ChuckerIOS'u etkinleştir
let configuration = ChuckerConfiguration(
showNotifications: true,
redactHeaders: ["Authorization"],
maxTransactions: 1000,
enableFloatingButton: true,
notificationTitle: "Debug Network"
)
ChuckerIOS.shared.configure(with: configuration)
ChuckerIOS.shared.start()
#else
// Release modunda ChuckerIOS'u devre dışı bırak
// ChuckerIOS.shared.stop()
#endif// Özel URLSession yapılandırması
let config = URLSessionConfiguration.default
config.timeoutIntervalForRequest = 30
config.timeoutIntervalForResource = 60
let session = URLSession(configuration: config)
// Bu session da ChuckerIOS tarafından yakalanır
let task = session.dataTask(with: url) { data, response, error in
// Handle response
}
task.resume()import Alamofire
import ChuckerIOS
// Alamofire istekleri de ChuckerIOS tarafından yakalanır
AF.request("https://api.example.com/data")
.responseJSON { response in
// Handle response
}- Shows all captured HTTP requests
- Search and filter functionality
- Status indicators (success, error, pending)
- Tap to view details
- Complete request/response information
- Headers, body, timing data
- Share functionality
- Copy to clipboard
- Quick access to the inspector
- Badge showing request count
- Customizable position and appearance
- iOS 13.0+
- Xcode 12.0+
- Swift 5.0+
ChuckerIOS uses several key components:
- URLSessionInterceptor: Intercepts network requests using method swizzling
- TransactionStorage: Manages storage of HTTP transactions
- NotificationManager: Handles local notifications
- FloatingButtonManager: Manages the floating button UI
- UI Controllers: Storyboard-based interface for viewing transactions
- Never use in production builds
- Sensitive data (headers, body) may be stored locally
- Use header redaction to hide sensitive information
- Consider using different configurations for debug/release builds
Contributions are welcome! Please feel free to submit a Pull Request.
- Clone the repository
- Open the project in Xcode
- Build and run the demo app
- Make your changes
- Test thoroughly
- Submit a pull request
ChuckerIOS is released under the Apache License 2.0. See LICENSE for details.
- Inspired by Chucker for Android
- Built with ❤️ for the iOS development community
The repository includes a demo app that shows how to integrate and use ChuckerIOS. Run the demo to see all features in action.
// Storyboard dosyasının bundle'a dahil edildiğinden emin olun
// Xcode'da ChuckerIOS.storyboard dosyasının Target Membership'ini kontrol edin// ChuckerIOS'un başlatıldığından emin olun
ChuckerIOS.shared.start()
// URLSession.shared kullandığınızdan emin olun
// Özel URLSession instance'ları da yakalanır// Notification permission'ı kontrol edin
UNUserNotificationCenter.current().getNotificationSettings { settings in
if settings.authorizationStatus == .denied {
// Kullanıcıdan permission isteyin
}
}// Configuration'da enableFloatingButton: true olduğundan emin olun
let configuration = ChuckerConfiguration(enableFloatingButton: true)- Swift Package Manager ile eklediyseniz, package'ın doğru eklendiğini kontrol edin
- Manual installation yaptıysanız, dosyaların doğru target'a eklendiğini kontrol edin
- Clean Build Folder yapın (Product > Clean Build Folder)
// Bundle.module kullanımını kontrol edin
let storyboard = UIStoryboard(name: "ChuckerIOS", bundle: Bundle.module)#if DEBUG
// Debug modunda detaylı log'lar
print("ChuckerIOS: Starting network monitoring")
print("ChuckerIOS: Configuration: \(configuration)")
#endif// Büyük uygulamalar için transaction limit'ini ayarlayın
let configuration = ChuckerConfiguration(maxTransactions: 100) // Daha az memory kullanır
// Production'da ChuckerIOS'u devre dışı bırakın
#if !DEBUG
ChuckerIOS.shared.stop()
#endifSorun yaşıyorsanız veya sorularınız varsa:
- Issues sayfasını kontrol edin
- Detaylı bilgi ile yeni bir issue oluşturun
- iOS versiyonu, Xcode versiyonu ve adımları dahil edin
- Repository'yi fork edin
- Feature branch oluşturun (
git checkout -b feature/amazing-feature) - Değişikliklerinizi commit edin (
git commit -m 'Add amazing feature') - Branch'inizi push edin (
git push origin feature/amazing-feature) - Pull Request oluşturun
Made with ❤️ for iOS developers