如何在ios设备上启动本机应用程序时进行调试

如何在ios设备上启动本机应用程序时进行调试,第1张

概述当我启动反应本地应用程序,它始终启动,只要我连接到mac. 一旦我断开iphone,应用程序大多挂起启动和崩溃,没有任何进一步的错误消息. 但是,其他错误会显示在屏幕上(红色和黄色标记的错误). 当我双击主屏幕时,奇怪的是,应用程序似乎处于启动状态,但是我无法切换到它. 如何调试最好的这样的行为,找到引起奇怪启动行为的事情? 更新: 我发现这些错误 2016-08-08 16:25:23.604 当我启动反应本地应用程序,它始终启动,只要我连接到mac.

一旦我断开iphone,应用程序大多挂起启动和崩溃,没有任何进一步的错误消息.
但是,其他错误会显示在屏幕上(红色和黄色标记的错误).

当我双击主屏幕时,奇怪的是,应用程序似乎处于启动状态,但是我无法切换到它.

如何调试最好的这样的行为,找到引起奇怪启动行为的事情?

更新:

我发现这些错误

2016-08-08 16:25:23.604 [warn][tID:main][RCTEventEmitter.m:54] Sending `websocketFailed` with no Listeners registered.2016-08-08 16:25:23.612113 PhoenixApp[525:64778] Sending `websocketFailed` with no Listeners registered.2016-08-08 16:25:23.742 [warn][tID:com.facebook.react.JavaScript] The regenerator/runtime module is deprecated; please import regenerator-runtime/runtime instead.2016-08-08 16:25:23.741927 PhoenixApp[525:65027] The regenerator/runtime module is deprecated; please import regenerator-runtime/runtime instead.2016-08-08 16:25:23.860 [info][tID:com.facebook.react.JavaScript] Running application "PhoenixApp" with appParams: {"roottag":1,"initialProps":{}}. __DEV__ === true,development-level warning are ON,performance optimizations are OFF2016-08-08 16:25:23.860251 PhoenixApp[525:65027] Running application "PhoenixApp" with appParams: {"roottag":1,performance optimizations are OFF2016-08-08 16:25:24.139 [info][tID:com.facebook.react.JavaScript] null2016-08-08 16:25:24.138808 PhoenixApp[525:65027] null

其次是(每秒)

2016-08-08 16:31:43.159749 PhoenixApp[525:64956] [] __nw_connection_get_connected_socket_block_invoke 176 Connection has no connected handler2016-08-08 16:31:45.372329 PhoenixApp[525:65445] [] __nw_connection_get_connected_socket_block_invoke 177 Connection has no connected handler2016-08-08 16:31:47.575208 PhoenixApp[525:64955] [] __nw_connection_get_connected_socket_block_invoke 178 Connection has no connected handler2016-08-08 16:31:49.788935 PhoenixApp[525:65445] [] __nw_connection_get_connected_socket_block_invoke 179 Connection has no connected handler2016-08-08 16:31:51.970877 PhoenixApp[525:64955] [] __nw_connection_get_connected_socket_block_invoke 180 Connection has no connected handler2016-08-08 16:31:54.173791 PhoenixApp[525:65445] [] __nw_connection_get_connected_socket_block_invoke 181 Connection has no connected handler

AppDelegate.m

/** * copyright (c) 2015-present,Facebook,Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * liCENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. */#import "AppDelegate.h"#import "RCTBundleURLProvIDer.h"#import "RCTRootVIEw.h"@implementation AppDelegate- (BOol)application:(UIApplication *)application dIDFinishLaunchingWithOptions:(NSDictionary *)launchOptions{  NSURL *JsCodeLocation;  [[RCTBundleURLProvIDer sharedSettings] setDefaults];  JsCodeLocation = [[RCTBundleURLProvIDer sharedSettings] JsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];  RCTRootVIEw *rootVIEw = [[RCTRootVIEw alloc] initWithBundleURL:JsCodeLocation                                                      modulename:@"PhoenixTrello"                                               initialPropertIEs:nil                                                   launchOptions:launchOptions];  rootVIEw.backgroundcolor = [[UIcolor alloc] initWithRed:1.0f green:1.0f blue:1.0f Alpha:1];  self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];  UIVIEwController *rootVIEwController = [UIVIEwController new];  rootVIEwController.vIEw = rootVIEw;  self.window.rootVIEwController = rootVIEwController;  [self.window makeKeyAndVisible];  return YES;}@end

建立:

react-native-cli:1.0.0
react-native:0.32.0-rc.0
反应:15.3.0

Xcode 8 beta 4,iOS 10

解决方法 尝试在发布模式下构建应用程序.

编辑方案

>选择运行选项卡
>选择信息选项卡
>更改构建配置以释放
>建立并运行项目

当您的设备连接到xCode时,xCode会执行一些 *** 作/优化并附加调试器.有时此 *** 作会阻止显示错误.如果您在发布模式下运行应用程序,则会忽略此 *** 作,并且应用程序崩溃.

总结

以上是内存溢出为你收集整理的如何在ios设备上启动本机应用程序时进行调试全部内容,希望文章能够帮你解决如何在ios设备上启动本机应用程序时进行调试所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1110129.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-29
下一篇 2022-05-29

发表评论

登录后才能评论

评论列表(0条)

保存