### Start server with custom directories (Objective-C) Source: https://github.com/y500/iosdebugdatabase/blob/master/README.md Example of starting the server with custom directories including the app bundle resource path, a database directory, Documents, and Library/Cache. ```objc NSString *resourceDirectory = [[NSBundle mainBundle] resourcePath]; NSString *databaseDirectory = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/database"]; NSString *documentDirectory = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"]; NSString *cacheDirectory = [NSHomeDirectory() stringByAppendingPathComponent:@"Library/Cache"]; [[DebugDatabaseManager shared] startServerOnPort:9002 directories:@[resourceDirectory, databaseDirectory, documentDirectory, cacheDirectory]]; ``` -------------------------------- ### Start DebugDatabaseManager server on port 9002 (Objective-C) Source: https://github.com/y500/iosdebugdatabase/blob/master/README.md Start the debug database server on port 9002 in application:didFinishLaunchingWithOptions. This is the minimal setup for Objective-C. ```objc [[DebugDatabaseManager shared] startServerOnPort:9002]; ``` -------------------------------- ### Start server with custom directories (Swift) Source: https://github.com/y500/iosdebugdatabase/blob/master/README.md Swift equivalent for starting the server with custom directories: app bundle resource path, Documents, and Caches. ```swift let directory:String = (Bundle.main.resourcePath)!; let documentsPath:String = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)[0] let cachePath:String = NSSearchPathForDirectoriesInDomains(.cachesDirectory, .userDomainMask, true)[0] DebugDatabaseManager.shared().startServer(onPort: 9002, directories: [directory, documentsPath, cachePath]); ``` -------------------------------- ### Install pods with pod install Source: https://github.com/y500/iosdebugdatabase/blob/master/README.md Run pod install after adding the pod to your Podfile. ```bash $ pod install ``` -------------------------------- ### startServerOnPort:directories: method signature Source: https://github.com/y500/iosdebugdatabase/blob/master/README.md Method signature for starting the server with custom directories. By default only Documents and Library/Cache are shown; use this to include other directories. ```objc - (void)startServerOnPort:(NSInteger)port directories:(NSArray*)directories ``` -------------------------------- ### Start server only in DEBUG builds (Objective-C) Source: https://github.com/y500/iosdebugdatabase/blob/master/README.md Wrap the server start call in a DEBUG preprocessor check to prevent it from running in Release builds. Note the source uses #end instead of #endif. ```objc #ifdef DEBUG [[DebugDatabaseManager shared] startServerOnPort:9002]; #end ``` -------------------------------- ### Start DebugDatabaseManager server on port 9002 (Swift) Source: https://github.com/y500/iosdebugdatabase/blob/master/README.md Start the debug database server on port 9002 in the Swift AppDelegate's didFinishLaunchingWithOptions method. ```swift DebugDatabaseManager.shared().startServer(onPort: 9002); ``` -------------------------------- ### License notice Source: https://github.com/y500/iosdebugdatabase/blob/master/README.md Apache License 2.0 notice for the project. ```text Copyright (C) 2016 y500 Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ``` -------------------------------- ### Add YYDebugDatabase with use_frameworks! for Swift Source: https://github.com/y500/iosdebugdatabase/blob/master/README.md For Swift projects, add use_frameworks! before the pod declaration. ```ruby use_frameworks! pod 'YYDebugDatabase' ``` -------------------------------- ### Console output with server addresses Source: https://github.com/y500/iosdebugdatabase/blob/master/README.md Console output showing the server's IP address and Bonjour name. Use these addresses to access the debug database from your browser. ```text [INFO] DebugDatabaseManager started on port 9002 and reachable at http://192.168.0.67:9002/ [INFO] DebugDatabaseManager now locally reachable at http://y500.local:9002/ ``` -------------------------------- ### Import DebugDatabaseManager in AppDelegate.m Source: https://github.com/y500/iosdebugdatabase/blob/master/README.md Import the DebugDatabaseManager header in AppDelegate.m before using the manager. ```objc #import DebugDatabaseManager.h ``` -------------------------------- ### Import YYDebugDatabase in AppDelegate.swift Source: https://github.com/y500/iosdebugdatabase/blob/master/README.md Import the YYDebugDatabase module in AppDelegate.swift before using the manager. ```swift import YYDebugDatabase ``` -------------------------------- ### Add YYDebugDatabase to Cartfile Source: https://github.com/y500/iosdebugdatabase/blob/master/README.md Add the repository to your Cartfile for Carthage integration. ```plaintext github "y500/iOSDebugDatabase" ``` -------------------------------- ### Add YYDebugDatabase to Podfile Source: https://github.com/y500/iosdebugdatabase/blob/master/README.md Add YYDebugDatabase to your Podfile for CocoaPods integration. ```ruby pod 'YYDebugDatabase' ``` -------------------------------- ### Restrict YYDebugDatabase to Debug configurations Source: https://github.com/y500/iosdebugdatabase/blob/master/README.md Restrict YYDebugDatabase to Debug configurations only. ```ruby pod 'YYDebugDatabase', :configurations => ['Debug'] ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.