├── .DS_Store ├── DebugServerHost.podspec ├── DebugServerHost ├── .DS_Store ├── Assets │ └── .gitkeep └── Classes │ ├── .DS_Store │ ├── .gitkeep │ ├── DevServerAddr.h │ ├── DevServerAddr.m │ ├── DevServerAddrViewController.h │ ├── DevServerAddrViewController.m │ ├── UIViewController+Utils.h │ └── UIViewController+Utils.m ├── LICENSE ├── ReadMe.md ├── image ├── .DS_Store ├── 1.png └── 2.png ├── index.js ├── ios └── DebugServerHost.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ └── IDEWorkspaceChecks.plist │ └── xcuserdata │ │ └── hong.xcuserdatad │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ └── hong.xcuserdatad │ └── xcschemes │ ├── DebugServerHost.xcscheme │ └── xcschememanagement.plist └── package.json /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xuwening/react-native-debug-server-host/103902d4b73860f6fe00160ae27627a560551858/.DS_Store -------------------------------------------------------------------------------- /DebugServerHost.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # Be sure to run `pod spec lint react-native-diff-update.podspec' to ensure this is a 3 | # valid spec and to remove all comments including this before submitting the spec. 4 | # 5 | # To learn more about Podspec attributes see http://docs.cocoapods.org/specification.html 6 | # To see working Podspecs in the CocoaPods repo see https://github.com/CocoaPods/Specs/ 7 | # 8 | 9 | Pod::Spec.new do |s| 10 | 11 | s.name = "DebugServerHost" 12 | s.version = "0.3.5" 13 | s.summary = "change server host dynamically." 14 | 15 | s.description = <<-DESC 16 | change server host dynamically. 17 | DESC 18 | 19 | s.homepage = "https://github.com/xuwening/react-native-debug-server-host.git" 20 | # s.screenshots = "www.example.com/screenshots_1.gif", "www.example.com/screenshots_2.gif" 21 | 22 | s.license = { :type => 'MIT', :file => 'LICENSE' } 23 | s.author = { "hongjingjun" => "xuwening@126.com" } 24 | 25 | # s.platform = :ios 26 | # s.platform = :ios, "5.0" 27 | s.ios.deployment_target = '8.0' 28 | 29 | #s.library = 'z', 'bz2' 30 | s.dependency 'React' 31 | #s.dependency 'SSZipArchive' 32 | 33 | 34 | s.source_files = 'DebugServerHost/Classes/*.{h,m}' 35 | #s.public_header_files = ['DebugServerHost/Classes/*.h'] 36 | 37 | 38 | s.source = { :git => "https://github.com/xuwening/react-native-debug-server-host.git", :tag => "#{s.version}" } 39 | 40 | # s.preserve_paths = "FilesToSave", "MoreFilesToSave" 41 | 42 | # s.framework = "SomeFramework" 43 | # s.frameworks = "SomeFramework", "AnotherFramework" 44 | 45 | # s.library = "iconv" 46 | # s.libraries = "iconv", "xml2" 47 | 48 | 49 | end 50 | -------------------------------------------------------------------------------- /DebugServerHost/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xuwening/react-native-debug-server-host/103902d4b73860f6fe00160ae27627a560551858/DebugServerHost/.DS_Store -------------------------------------------------------------------------------- /DebugServerHost/Assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xuwening/react-native-debug-server-host/103902d4b73860f6fe00160ae27627a560551858/DebugServerHost/Assets/.gitkeep -------------------------------------------------------------------------------- /DebugServerHost/Classes/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xuwening/react-native-debug-server-host/103902d4b73860f6fe00160ae27627a560551858/DebugServerHost/Classes/.DS_Store -------------------------------------------------------------------------------- /DebugServerHost/Classes/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xuwening/react-native-debug-server-host/103902d4b73860f6fe00160ae27627a560551858/DebugServerHost/Classes/.gitkeep -------------------------------------------------------------------------------- /DebugServerHost/Classes/DevServerAddr.h: -------------------------------------------------------------------------------- 1 | // 2 | // DevServerAddr.h 3 | // reactDemo 4 | // 5 | // Created by 洪敬军 on 16/6/24. 6 | // Copyright © 2016年 Facebook. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DevServerAddr : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /DebugServerHost/Classes/DevServerAddr.m: -------------------------------------------------------------------------------- 1 | // 2 | // DevServerAddr.m 3 | // reactDemo 4 | // 5 | // Created by 洪敬军 on 16/6/24. 6 | // Copyright © 2016年 Facebook. All rights reserved. 7 | // 8 | 9 | #import "DevServerAddr.h" 10 | #import "RCTDevMenu.h" 11 | #import "RCTUtils.h" 12 | #import "DevServerAddrViewController.h" 13 | #import "UIViewController+Utils.h" 14 | 15 | NSString * const ChangeServerAddrNotification = @"com.change.server.addr"; 16 | 17 | #if RCT_DEV 18 | @implementation RCTDevMenu (serverAddr) 19 | 20 | 21 | - (NSArray *)newMenuItems { 22 | 23 | NSMutableArray *items = (NSMutableArray *)[self newMenuItems]; 24 | 25 | RCTDevMenuItem *item = [RCTDevMenuItem buttonItemWithTitle:@"Debug server host" handler:^{ 26 | 27 | [[NSNotificationCenter defaultCenter] postNotificationName:ChangeServerAddrNotification 28 | object:nil 29 | userInfo:nil]; 30 | 31 | }]; 32 | 33 | [items addObject: item]; 34 | 35 | return items; 36 | } 37 | 38 | @end 39 | #endif 40 | 41 | @implementation DevServerAddr { 42 | 43 | DevServerAddrViewController *_serverAddrviewController; 44 | } 45 | 46 | 47 | +(void) load { 48 | 49 | RCTSwapInstanceMethods([RCTDevMenu class], @selector(_menuItemsToPresent), @selector(newMenuItems)); 50 | 51 | static const DevServerAddr *_static_Dev_addr; 52 | static dispatch_once_t onceToken; 53 | dispatch_once(&onceToken, ^{ 54 | 55 | _static_Dev_addr = [[DevServerAddr alloc] init]; 56 | }); 57 | } 58 | 59 | 60 | -(instancetype)init { 61 | 62 | self = [super init]; 63 | if (self) { 64 | 65 | _serverAddrviewController = [[DevServerAddrViewController alloc] init]; 66 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeServerAddr:) name:ChangeServerAddrNotification object:nil]; 67 | } 68 | 69 | return self; 70 | } 71 | 72 | 73 | - (void)changeServerAddr:(NSNotification *)notification { 74 | 75 | UIViewController *controller = [UIViewController currentViewController]; 76 | if (controller == nil) { 77 | return ; 78 | } 79 | 80 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 81 | 82 | // if ([controller isKindOfClass: [UINavigationController class]]) { 83 | 84 | [controller presentViewController:_serverAddrviewController animated:YES completion:^{ 85 | NSLog(@""); 86 | }]; 87 | // } 88 | }); 89 | 90 | } 91 | 92 | -(void)dealloc { 93 | 94 | [[NSNotificationCenter defaultCenter] removeObserver: self]; 95 | } 96 | 97 | 98 | @end 99 | -------------------------------------------------------------------------------- /DebugServerHost/Classes/DevServerAddrViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // DevServerAddrViewController.h 3 | // reactDemo 4 | // 5 | // Created by 洪敬军 on 16/6/24. 6 | // Copyright © 2016年 Facebook. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DevServerAddrViewController : UIViewController 12 | 13 | 14 | @property(nonatomic, strong) UITextField *urlTextField; 15 | @property(nonatomic, strong) UIButton *qrScanButton; 16 | @property(nonatomic, strong) UIButton *cancelButton; 17 | @property(nonatomic, strong) UIButton *okButton; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /DebugServerHost/Classes/DevServerAddrViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // DevServerAddrViewController.m 3 | // reactDemo 4 | // 5 | // Created by 洪敬军 on 16/6/24. 6 | // Copyright © 2016年 Facebook. All rights reserved. 7 | // 8 | 9 | #import "DevServerAddrViewController.h" 10 | 11 | #define SCREEN_WIDTH [UIScreen mainScreen].bounds.size.width 12 | #define SCREEN_HEIGHT [UIScreen mainScreen].bounds.size.height 13 | 14 | @interface DevServerAddrViewController() 15 | 16 | @end 17 | 18 | @implementation DevServerAddrViewController 19 | 20 | -(void)viewDidLoad { 21 | 22 | [self.view addSubview: self.urlTextField]; 23 | // [self.view addSubview: self.qrScanButton]; 24 | [self.view addSubview: self.cancelButton]; 25 | [self.view addSubview: self.okButton]; 26 | 27 | self.view.backgroundColor = [UIColor whiteColor]; 28 | 29 | // self.urlTextField.text = [[NSUserDefaults standardUserDefaults] objectForKey:@"RCT_SERVER_ADDR_URL"] ? : @""; 30 | 31 | UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapAction:)]; 32 | [self.view addGestureRecognizer: tap]; 33 | } 34 | 35 | -(IBAction)tapAction:(id)sender { 36 | 37 | [self.urlTextField resignFirstResponder]; 38 | } 39 | 40 | -(UITextField *)urlTextField { 41 | if (_urlTextField == nil) { 42 | 43 | CGRect rect = CGRectMake(10, 200, SCREEN_WIDTH-20, 40); 44 | 45 | _urlTextField = [[UITextField alloc] initWithFrame: rect]; 46 | _urlTextField.borderStyle = UITextBorderStyleRoundedRect; 47 | _urlTextField.placeholder = @"Input URL manual"; 48 | _urlTextField.text = [[NSUserDefaults standardUserDefaults] stringForKey:@"RCT_jsLocation"]; 49 | // _urlTextField.backgroundColor = [UIColor redColor]; 50 | } 51 | 52 | return _urlTextField; 53 | } 54 | 55 | -(UIButton *)qrScanButton { 56 | if (_qrScanButton == nil) { 57 | 58 | _qrScanButton = [UIButton buttonWithType:UIButtonTypeSystem]; 59 | 60 | CGRect rect = CGRectMake(10, 300, SCREEN_WIDTH-20, 40); 61 | _qrScanButton.frame = rect; 62 | _qrScanButton.titleLabel.font = [UIFont systemFontOfSize:18]; 63 | [_qrScanButton setTitle:@"Input URL With QRScan" forState:UIControlStateNormal]; 64 | [_qrScanButton addTarget:self action:@selector(qrAction:) forControlEvents:UIControlEventTouchUpInside]; 65 | 66 | } 67 | 68 | return _qrScanButton; 69 | } 70 | 71 | -(UIButton *)cancelButton { 72 | if (_cancelButton == nil) { 73 | 74 | _cancelButton = [UIButton buttonWithType:UIButtonTypeSystem]; 75 | 76 | CGRect rect = CGRectMake(SCREEN_WIDTH-10-80, SCREEN_HEIGHT-40-40, 80, 40); 77 | _cancelButton.frame = rect; 78 | _cancelButton.titleLabel.font = [UIFont systemFontOfSize:18]; 79 | [_cancelButton setTitle:@"Cancel" forState:UIControlStateNormal]; 80 | [_cancelButton addTarget:self action:@selector(cancelAction:) forControlEvents:UIControlEventTouchUpInside]; 81 | } 82 | 83 | return _cancelButton; 84 | } 85 | 86 | -(UIButton *)okButton { 87 | if (_okButton == nil) { 88 | 89 | _okButton = [UIButton buttonWithType:UIButtonTypeSystem]; 90 | 91 | CGRect rect = CGRectMake(10, SCREEN_HEIGHT-40-40, 80, 40); 92 | _okButton.frame = rect; 93 | _okButton.titleLabel.font = [UIFont systemFontOfSize:18]; 94 | [_okButton setTitle:@"OK" forState:UIControlStateNormal]; 95 | [_okButton addTarget:self action:@selector(okAction:) forControlEvents:UIControlEventTouchUpInside]; 96 | } 97 | 98 | return _okButton; 99 | } 100 | 101 | -(IBAction)okAction:(id)sender { 102 | 103 | NSString *url = [_urlTextField.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]; 104 | 105 | [[NSUserDefaults standardUserDefaults] setObject:url forKey:@"RCT_jsLocation"]; 106 | [[NSUserDefaults standardUserDefaults] synchronize]; 107 | 108 | [self dismissViewControllerAnimated:YES completion:^{ 109 | 110 | [[NSNotificationCenter defaultCenter] postNotificationName:@"RCTReloadNotification" 111 | object:nil 112 | userInfo:nil]; 113 | }]; 114 | } 115 | 116 | -(IBAction)cancelAction:(id)sender { 117 | 118 | [self dismissViewControllerAnimated:YES completion:^{ 119 | 120 | }]; 121 | } 122 | 123 | 124 | 125 | @end 126 | -------------------------------------------------------------------------------- /DebugServerHost/Classes/UIViewController+Utils.h: -------------------------------------------------------------------------------- 1 | // 2 | // DevServerAddr.h 3 | // reactDemo 4 | // 5 | // Created by 洪敬军 on 16/6/24. 6 | 7 | #import 8 | 9 | @interface UIViewController (Utils) 10 | 11 | +(UIViewController*) currentViewController; 12 | +(UIViewController*) findBestViewController:(UIViewController*)vc; 13 | @end 14 | -------------------------------------------------------------------------------- /DebugServerHost/Classes/UIViewController+Utils.m: -------------------------------------------------------------------------------- 1 | 2 | #import "UIViewController+Utils.h" 3 | 4 | @implementation UIViewController (Utils) 5 | 6 | +(UIViewController*) findBestViewController:(UIViewController*)vc { 7 | 8 | if ([vc isKindOfClass: [UINavigationController class]]) { 9 | return vc; 10 | } 11 | 12 | if (vc.presentedViewController) { 13 | 14 | // Return presented view controller 15 | return [UIViewController findBestViewController:vc.presentedViewController]; 16 | 17 | } else if ([vc isKindOfClass:[UISplitViewController class]]) { 18 | 19 | // Return right hand side 20 | UISplitViewController* svc = (UISplitViewController*) vc; 21 | if (svc.viewControllers.count > 0) 22 | return [UIViewController findBestViewController:svc.viewControllers.lastObject]; 23 | else 24 | return vc; 25 | 26 | } else if ([vc isKindOfClass:[UINavigationController class]]) { 27 | 28 | // Return top view 29 | UINavigationController* svc = (UINavigationController*) vc; 30 | if (svc.viewControllers.count > 0) 31 | return [UIViewController findBestViewController:svc.topViewController]; 32 | else 33 | return vc; 34 | 35 | } else if ([vc isKindOfClass: NSClassFromString(@"CMSlideRootViewController")]) { 36 | 37 | if ([vc respondsToSelector:@selector(currentViewController)]) { 38 | return [UIViewController findBestViewController: [vc performSelector:@selector(currentViewController)]]; 39 | } else { 40 | return nil; 41 | } 42 | } else if ([vc isKindOfClass:[UITabBarController class]]) { 43 | 44 | // Return visible view 45 | UITabBarController* svc = (UITabBarController*) vc; 46 | if (svc.viewControllers.count > 0) 47 | return [UIViewController findBestViewController:svc.selectedViewController]; 48 | else 49 | return vc; 50 | 51 | } else { 52 | 53 | // Unknown view controller type, return last child view controller 54 | return nil; 55 | 56 | } 57 | 58 | } 59 | 60 | +(UIViewController*) currentViewController { 61 | 62 | // Find best view controller 63 | UIViewController* viewController = [UIApplication sharedApplication].keyWindow.rootViewController; 64 | UIViewController *last = [UIViewController findBestViewController:viewController]; 65 | if (last == nil) { 66 | return viewController; 67 | } 68 | 69 | return last; 70 | } 71 | 72 | @end 73 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016 xuwening 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /ReadMe.md: -------------------------------------------------------------------------------- 1 | 2 | # Debug Server Host For iOS 3 | 4 | ## 更新(2017.10.12) 5 | 6 | > 增加pod集成方式 7 | 8 | > 解决根rootViewController不是navigation时,无法显示debugHost界面的bug 9 | 10 | ## 更新 (2017.6.20) 11 | 12 | > 半年没关注 RN 发现变化还真不少,由于调试函数发生变化,这个库也需要更新下否则不起作用(最新RN版本0.45)。 13 | 14 | > 如需兼容多版本,RN 版本判断下,然后设置`RCTSwapInstanceMethods([RCTDevMenu class], @selector(_menuItemsToPresent), @selector(newMenuItems));`中的@selector即可。 15 | 16 | ## 更新(2016.11.28) 17 | 18 | > 增加了`rnpm install react-native-DebugServerHost`的支持。 19 | 20 | ## 更新(2016.11.15) 21 | 22 | > 由于react native更换的URL的使用方式(增加了RCTBundleURLProvider类处理URL),所以旧的方式不再适应,进行新版本的改造,不再适配v0.29以下版本。新方式下只需输入IP地址,比较好输入,因此去掉了二维码扫描方式。 23 | 24 | 25 | ## React Native服务器地址更换 26 | 27 | 运行时更换服务器地址,不用为更换调试服务器地址而频繁打包。android调试状态有更换服务器地址功能,而iOS不具备此功能,本库就是为iOS提供此功能。 28 | 29 | ![](./image/1.png) 30 | 31 | ## 集成 32 | 33 | #### 自动集成 34 | 35 | `npm install react-native-DebugServerHost --save` 36 | 37 | `react-native link` 38 | 39 | #### pod集成 40 | 41 | `npm install react-native-DebugServerHost --save` 42 | 43 | podFile文件添加: 44 | 45 | `pod 'DebugServerHost', :path => '../node_modules/react-native-DebugServerHost'` 46 | 47 | `pod install` 48 | 49 | #### 手动集成: 50 | 51 | 直接将DebugServerHost文件夹添加到项目中即可,无需任何设置。 52 | 53 | 54 | ## 使用 55 | 56 | 模拟器使用`Command+D`,真实设备使用摇一摇即可唤出调试菜单,选择最后一项`Debug server host`就可以修改服务器地址了。 57 | 58 | ![](./image/2.png) 59 | 60 | > 注意:修改完地址需要重新启动APP才能生效。 61 | 62 | > 由于RN在debug模式下,会自动在安装包中添加ip.txt文件,保存开发机IP地址,并将main.jsbundle集成到APP中。首先通过IP地址去访问远程js脚本,如果没有找到,则使用安装目录中的main.jsbundle。但是目前在0.37版本中,第一步如果IP地址不正确,经常造成闪退。如果是这种情况,***可以先把手机网络全关,打开APP加载本地main.jsbundle后再更换正确的服务器地址***,或者更简单的方式***删除app重新安装***。 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /image/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xuwening/react-native-debug-server-host/103902d4b73860f6fe00160ae27627a560551858/image/.DS_Store -------------------------------------------------------------------------------- /image/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xuwening/react-native-debug-server-host/103902d4b73860f6fe00160ae27627a560551858/image/1.png -------------------------------------------------------------------------------- /image/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xuwening/react-native-debug-server-host/103902d4b73860f6fe00160ae27627a560551858/image/2.png -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xuwening/react-native-debug-server-host/103902d4b73860f6fe00160ae27627a560551858/index.js -------------------------------------------------------------------------------- /ios/DebugServerHost.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | F122E7BD21006FA5007B31B4 /* DevServerAddrViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F122E7B621006FA4007B31B4 /* DevServerAddrViewController.m */; }; 11 | F122E7BE21006FA5007B31B4 /* DevServerAddr.m in Sources */ = {isa = PBXBuildFile; fileRef = F122E7B721006FA4007B31B4 /* DevServerAddr.m */; }; 12 | F122E7BF21006FA5007B31B4 /* UIViewController+Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = F122E7B821006FA4007B31B4 /* UIViewController+Utils.m */; }; 13 | /* End PBXBuildFile section */ 14 | 15 | /* Begin PBXCopyFilesBuildPhase section */ 16 | F1F3E2F221003D8300A8B512 /* CopyFiles */ = { 17 | isa = PBXCopyFilesBuildPhase; 18 | buildActionMask = 2147483647; 19 | dstPath = "include/$(PRODUCT_NAME)"; 20 | dstSubfolderSpec = 16; 21 | files = ( 22 | ); 23 | runOnlyForDeploymentPostprocessing = 0; 24 | }; 25 | /* End PBXCopyFilesBuildPhase section */ 26 | 27 | /* Begin PBXFileReference section */ 28 | F122E7B421006FA4007B31B4 /* UIViewController+Utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIViewController+Utils.h"; sourceTree = ""; }; 29 | F122E7B521006FA4007B31B4 /* .gitkeep */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = .gitkeep; sourceTree = ""; }; 30 | F122E7B621006FA4007B31B4 /* DevServerAddrViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DevServerAddrViewController.m; sourceTree = ""; }; 31 | F122E7B721006FA4007B31B4 /* DevServerAddr.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DevServerAddr.m; sourceTree = ""; }; 32 | F122E7B821006FA4007B31B4 /* UIViewController+Utils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIViewController+Utils.m"; sourceTree = ""; }; 33 | F122E7B921006FA4007B31B4 /* DevServerAddr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DevServerAddr.h; sourceTree = ""; }; 34 | F122E7BA21006FA4007B31B4 /* DevServerAddrViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DevServerAddrViewController.h; sourceTree = ""; }; 35 | F122E7BC21006FA4007B31B4 /* .gitkeep */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = .gitkeep; sourceTree = ""; }; 36 | F1F3E2F421003D8300A8B512 /* libDebugServerHost.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libDebugServerHost.a; sourceTree = BUILT_PRODUCTS_DIR; }; 37 | /* End PBXFileReference section */ 38 | 39 | /* Begin PBXFrameworksBuildPhase section */ 40 | F1F3E2F121003D8300A8B512 /* Frameworks */ = { 41 | isa = PBXFrameworksBuildPhase; 42 | buildActionMask = 2147483647; 43 | files = ( 44 | ); 45 | runOnlyForDeploymentPostprocessing = 0; 46 | }; 47 | /* End PBXFrameworksBuildPhase section */ 48 | 49 | /* Begin PBXGroup section */ 50 | F122E7B221006FA4007B31B4 /* DebugServerHost */ = { 51 | isa = PBXGroup; 52 | children = ( 53 | F122E7B321006FA4007B31B4 /* Classes */, 54 | F122E7BB21006FA4007B31B4 /* Assets */, 55 | ); 56 | name = DebugServerHost; 57 | path = ../DebugServerHost; 58 | sourceTree = ""; 59 | }; 60 | F122E7B321006FA4007B31B4 /* Classes */ = { 61 | isa = PBXGroup; 62 | children = ( 63 | F122E7B421006FA4007B31B4 /* UIViewController+Utils.h */, 64 | F122E7B521006FA4007B31B4 /* .gitkeep */, 65 | F122E7B621006FA4007B31B4 /* DevServerAddrViewController.m */, 66 | F122E7B721006FA4007B31B4 /* DevServerAddr.m */, 67 | F122E7B821006FA4007B31B4 /* UIViewController+Utils.m */, 68 | F122E7B921006FA4007B31B4 /* DevServerAddr.h */, 69 | F122E7BA21006FA4007B31B4 /* DevServerAddrViewController.h */, 70 | ); 71 | path = Classes; 72 | sourceTree = ""; 73 | }; 74 | F122E7BB21006FA4007B31B4 /* Assets */ = { 75 | isa = PBXGroup; 76 | children = ( 77 | F122E7BC21006FA4007B31B4 /* .gitkeep */, 78 | ); 79 | path = Assets; 80 | sourceTree = ""; 81 | }; 82 | F1F3E2EB21003D8300A8B512 = { 83 | isa = PBXGroup; 84 | children = ( 85 | F122E7B221006FA4007B31B4 /* DebugServerHost */, 86 | F1F3E2F521003D8300A8B512 /* Products */, 87 | ); 88 | sourceTree = ""; 89 | }; 90 | F1F3E2F521003D8300A8B512 /* Products */ = { 91 | isa = PBXGroup; 92 | children = ( 93 | F1F3E2F421003D8300A8B512 /* libDebugServerHost.a */, 94 | ); 95 | name = Products; 96 | sourceTree = ""; 97 | }; 98 | /* End PBXGroup section */ 99 | 100 | /* Begin PBXNativeTarget section */ 101 | F1F3E2F321003D8300A8B512 /* DebugServerHost */ = { 102 | isa = PBXNativeTarget; 103 | buildConfigurationList = F1F3E2FD21003D8300A8B512 /* Build configuration list for PBXNativeTarget "DebugServerHost" */; 104 | buildPhases = ( 105 | F1F3E2F021003D8300A8B512 /* Sources */, 106 | F1F3E2F121003D8300A8B512 /* Frameworks */, 107 | F1F3E2F221003D8300A8B512 /* CopyFiles */, 108 | ); 109 | buildRules = ( 110 | ); 111 | dependencies = ( 112 | ); 113 | name = DebugServerHost; 114 | productName = DebugServerHost; 115 | productReference = F1F3E2F421003D8300A8B512 /* libDebugServerHost.a */; 116 | productType = "com.apple.product-type.library.static"; 117 | }; 118 | /* End PBXNativeTarget section */ 119 | 120 | /* Begin PBXProject section */ 121 | F1F3E2EC21003D8300A8B512 /* Project object */ = { 122 | isa = PBXProject; 123 | attributes = { 124 | LastUpgradeCheck = 0940; 125 | ORGANIZATIONNAME = leadeon; 126 | TargetAttributes = { 127 | F1F3E2F321003D8300A8B512 = { 128 | CreatedOnToolsVersion = 9.4.1; 129 | }; 130 | }; 131 | }; 132 | buildConfigurationList = F1F3E2EF21003D8300A8B512 /* Build configuration list for PBXProject "DebugServerHost" */; 133 | compatibilityVersion = "Xcode 9.3"; 134 | developmentRegion = en; 135 | hasScannedForEncodings = 0; 136 | knownRegions = ( 137 | en, 138 | ); 139 | mainGroup = F1F3E2EB21003D8300A8B512; 140 | productRefGroup = F1F3E2F521003D8300A8B512 /* Products */; 141 | projectDirPath = ""; 142 | projectRoot = ""; 143 | targets = ( 144 | F1F3E2F321003D8300A8B512 /* DebugServerHost */, 145 | ); 146 | }; 147 | /* End PBXProject section */ 148 | 149 | /* Begin PBXSourcesBuildPhase section */ 150 | F1F3E2F021003D8300A8B512 /* Sources */ = { 151 | isa = PBXSourcesBuildPhase; 152 | buildActionMask = 2147483647; 153 | files = ( 154 | F122E7BD21006FA5007B31B4 /* DevServerAddrViewController.m in Sources */, 155 | F122E7BF21006FA5007B31B4 /* UIViewController+Utils.m in Sources */, 156 | F122E7BE21006FA5007B31B4 /* DevServerAddr.m in Sources */, 157 | ); 158 | runOnlyForDeploymentPostprocessing = 0; 159 | }; 160 | /* End PBXSourcesBuildPhase section */ 161 | 162 | /* Begin XCBuildConfiguration section */ 163 | F1F3E2FB21003D8300A8B512 /* Debug */ = { 164 | isa = XCBuildConfiguration; 165 | buildSettings = { 166 | ALWAYS_SEARCH_USER_PATHS = NO; 167 | CLANG_ANALYZER_NONNULL = YES; 168 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 169 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 170 | CLANG_CXX_LIBRARY = "libc++"; 171 | CLANG_ENABLE_MODULES = YES; 172 | CLANG_ENABLE_OBJC_ARC = YES; 173 | CLANG_ENABLE_OBJC_WEAK = YES; 174 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 175 | CLANG_WARN_BOOL_CONVERSION = YES; 176 | CLANG_WARN_COMMA = YES; 177 | CLANG_WARN_CONSTANT_CONVERSION = YES; 178 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 179 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 180 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 181 | CLANG_WARN_EMPTY_BODY = YES; 182 | CLANG_WARN_ENUM_CONVERSION = YES; 183 | CLANG_WARN_INFINITE_RECURSION = YES; 184 | CLANG_WARN_INT_CONVERSION = YES; 185 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 186 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 187 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 188 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 189 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 190 | CLANG_WARN_STRICT_PROTOTYPES = YES; 191 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 192 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 193 | CLANG_WARN_UNREACHABLE_CODE = YES; 194 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 195 | CODE_SIGN_IDENTITY = "iPhone Developer"; 196 | COPY_PHASE_STRIP = NO; 197 | DEBUG_INFORMATION_FORMAT = dwarf; 198 | ENABLE_STRICT_OBJC_MSGSEND = YES; 199 | ENABLE_TESTABILITY = YES; 200 | GCC_C_LANGUAGE_STANDARD = gnu11; 201 | GCC_DYNAMIC_NO_PIC = NO; 202 | GCC_NO_COMMON_BLOCKS = YES; 203 | GCC_OPTIMIZATION_LEVEL = 0; 204 | GCC_PREPROCESSOR_DEFINITIONS = ( 205 | "DEBUG=1", 206 | "$(inherited)", 207 | ); 208 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 209 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 210 | GCC_WARN_UNDECLARED_SELECTOR = YES; 211 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 212 | GCC_WARN_UNUSED_FUNCTION = YES; 213 | GCC_WARN_UNUSED_VARIABLE = YES; 214 | IPHONEOS_DEPLOYMENT_TARGET = 11.4; 215 | MTL_ENABLE_DEBUG_INFO = YES; 216 | ONLY_ACTIVE_ARCH = YES; 217 | SDKROOT = iphoneos; 218 | }; 219 | name = Debug; 220 | }; 221 | F1F3E2FC21003D8300A8B512 /* Release */ = { 222 | isa = XCBuildConfiguration; 223 | buildSettings = { 224 | ALWAYS_SEARCH_USER_PATHS = NO; 225 | CLANG_ANALYZER_NONNULL = YES; 226 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 227 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 228 | CLANG_CXX_LIBRARY = "libc++"; 229 | CLANG_ENABLE_MODULES = YES; 230 | CLANG_ENABLE_OBJC_ARC = YES; 231 | CLANG_ENABLE_OBJC_WEAK = YES; 232 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 233 | CLANG_WARN_BOOL_CONVERSION = YES; 234 | CLANG_WARN_COMMA = YES; 235 | CLANG_WARN_CONSTANT_CONVERSION = YES; 236 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 237 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 238 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 239 | CLANG_WARN_EMPTY_BODY = YES; 240 | CLANG_WARN_ENUM_CONVERSION = YES; 241 | CLANG_WARN_INFINITE_RECURSION = YES; 242 | CLANG_WARN_INT_CONVERSION = YES; 243 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 244 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 245 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 246 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 247 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 248 | CLANG_WARN_STRICT_PROTOTYPES = YES; 249 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 250 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 251 | CLANG_WARN_UNREACHABLE_CODE = YES; 252 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 253 | CODE_SIGN_IDENTITY = "iPhone Developer"; 254 | COPY_PHASE_STRIP = NO; 255 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 256 | ENABLE_NS_ASSERTIONS = NO; 257 | ENABLE_STRICT_OBJC_MSGSEND = YES; 258 | GCC_C_LANGUAGE_STANDARD = gnu11; 259 | GCC_NO_COMMON_BLOCKS = YES; 260 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 261 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 262 | GCC_WARN_UNDECLARED_SELECTOR = YES; 263 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 264 | GCC_WARN_UNUSED_FUNCTION = YES; 265 | GCC_WARN_UNUSED_VARIABLE = YES; 266 | IPHONEOS_DEPLOYMENT_TARGET = 11.4; 267 | MTL_ENABLE_DEBUG_INFO = NO; 268 | SDKROOT = iphoneos; 269 | VALIDATE_PRODUCT = YES; 270 | }; 271 | name = Release; 272 | }; 273 | F1F3E2FE21003D8300A8B512 /* Debug */ = { 274 | isa = XCBuildConfiguration; 275 | buildSettings = { 276 | CODE_SIGN_STYLE = Automatic; 277 | OTHER_LDFLAGS = "-ObjC"; 278 | PRODUCT_NAME = "$(TARGET_NAME)"; 279 | SKIP_INSTALL = YES; 280 | TARGETED_DEVICE_FAMILY = "1,2"; 281 | USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/../../react-native/React/**"; 282 | }; 283 | name = Debug; 284 | }; 285 | F1F3E2FF21003D8300A8B512 /* Release */ = { 286 | isa = XCBuildConfiguration; 287 | buildSettings = { 288 | CODE_SIGN_STYLE = Automatic; 289 | OTHER_LDFLAGS = "-ObjC"; 290 | PRODUCT_NAME = "$(TARGET_NAME)"; 291 | SKIP_INSTALL = YES; 292 | TARGETED_DEVICE_FAMILY = "1,2"; 293 | USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/../../react-native/React/**"; 294 | }; 295 | name = Release; 296 | }; 297 | /* End XCBuildConfiguration section */ 298 | 299 | /* Begin XCConfigurationList section */ 300 | F1F3E2EF21003D8300A8B512 /* Build configuration list for PBXProject "DebugServerHost" */ = { 301 | isa = XCConfigurationList; 302 | buildConfigurations = ( 303 | F1F3E2FB21003D8300A8B512 /* Debug */, 304 | F1F3E2FC21003D8300A8B512 /* Release */, 305 | ); 306 | defaultConfigurationIsVisible = 0; 307 | defaultConfigurationName = Release; 308 | }; 309 | F1F3E2FD21003D8300A8B512 /* Build configuration list for PBXNativeTarget "DebugServerHost" */ = { 310 | isa = XCConfigurationList; 311 | buildConfigurations = ( 312 | F1F3E2FE21003D8300A8B512 /* Debug */, 313 | F1F3E2FF21003D8300A8B512 /* Release */, 314 | ); 315 | defaultConfigurationIsVisible = 0; 316 | defaultConfigurationName = Release; 317 | }; 318 | /* End XCConfigurationList section */ 319 | }; 320 | rootObject = F1F3E2EC21003D8300A8B512 /* Project object */; 321 | } 322 | -------------------------------------------------------------------------------- /ios/DebugServerHost.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/DebugServerHost.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/DebugServerHost.xcodeproj/project.xcworkspace/xcuserdata/hong.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xuwening/react-native-debug-server-host/103902d4b73860f6fe00160ae27627a560551858/ios/DebugServerHost.xcodeproj/project.xcworkspace/xcuserdata/hong.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /ios/DebugServerHost.xcodeproj/xcuserdata/hong.xcuserdatad/xcschemes/DebugServerHost.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 70 | 71 | 72 | 73 | 75 | 76 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /ios/DebugServerHost.xcodeproj/xcuserdata/hong.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | DebugServerHost.xcscheme 8 | 9 | orderHint 10 | 3 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | F1F3E2F321003D8300A8B512 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-native-DebugServerHost", 3 | "version": "0.3.6", 4 | "description": "React Native Debug server host for iOS ", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "git+https://github.com/xuwening/react-native-debug-server-host.git" 12 | }, 13 | "keywords": [ 14 | "react-native", 15 | "server", 16 | "host" 17 | ], 18 | "author": "xuwening", 19 | "license": "MIT", 20 | "bugs": { 21 | "url": "https://github.com/xuwening/react-native-debug-server-host/issues" 22 | }, 23 | "homepage": "https://github.com/xuwening/react-native-debug-server-host#readme" 24 | } 25 | --------------------------------------------------------------------------------