是否可以在 Xcode 中使用临时配置文件来调试我的应用程序? [英] Is it possible to debug my app with adhoc provisioning profile in Xcode?

查看:57
本文介绍了是否可以在 Xcode 中使用临时配置文件来调试我的应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如您所知,我将签名调试配置文件设置为临时配置配置文件.

As you know, I set the Signing debug profile to Adhoc provisioning profile.

如果我在我的 iPhone 上运行我的应用程序,那么我可以使用我的 iPhone 接收我后台的远程推送通知.(我的后台正在使用分发配置文件,所以我必须使用临时或分发配置文件).

If I run my app to my iPhone, so I can use my iPhone to receive my back-stage's remote push notification.(My back-stage is using distribution profile, so I must use the adhoc or distribution profile).

但是每次我在 iPhone 上运行应用程序(使用 Adhoc 配置文件)时,它都会断开连接:

But everytime I run the app(using Adhoc provisioning profile) to my iPhone, it will unconnect:

无法启动项目名称"
进程启动失败:无法获取进程xxx的任务

Could not launch "project name"
process launch failed: failed to get the task for process xxx

所以,我无法在我的 Xcode 中使用真实设备调试我的应用程序(使用 Adhoc 配置文件),有什么办法可以做到吗?

So, I can not debug my app (using Adhoc provisioning profile) with real device in my Xcode, is there any way to do that?

我的要求是去一个特殊的vc,我在didFinishLaunchingWithOptions方法中的代码如下:

My requirement is go to a special vc, my code in didFinishLaunchingWithOptions method is the below:

// If application is launched due to  notification,present another view controller.
UILocalNotification *notification = [launchOptions objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey];
if (notification)
{
    [SVProgressHUD showSuccessWithStatus:[NSString stringWithFormat:@"success"]];

    PushDetailViewController *detail_push = [[PushDetailViewController alloc] init];
    detail_push.isPresentCome = YES;

    PushModel *new_model = [PushModel initPushModelWithDic:notification.userInfo];

    if (new_model) {

        detail_push.pushModel = new_model;

        [self.window.rootViewController presentViewController:detail_push animated:NO completion:nil];

    }

}else {

    //LMLSystemAlertControllerShowSingelButtonWithMessageWL(@"没有notification 信息", @"确定");
}

return YES;

而且我不知道 notification.userInfo 是什么,所以我想调试它,如果我使用 SVProgressHUD 来提醒信息,我的应用程序将崩溃,因为我的 iphone 与 Xcode 未连接,我无法获取错误信息.

And I don't know the notification.userInfo is what, so I want debug it, and if I use SVProgressHUD to alert out the info, my app will crash, because my iphone is unconnected with Xcode, I can not get the error info.

所以,有一些问题:

  1. 是否可以在 Xcode 中使用我的 iphone 调试我的应用程序(使用临时配置文件)?
  2. notification.userInfo 的内容是什么,是我的后台推送的内容吗?
  3. 我推送的内容(来自我的后台)在哪里?
  1. Is it possible to debug my app(using adhoc provisioning profile) with my iphone in Xcode?
  2. notification.userInfo's content is what, does it is my push content from my back-state?
  3. My push content(from my back-state) is where?

<小时>

尝试 - 1

我试图提醒notification.userInfo,但是如果我访问notification.userInfo,我的应用程序会崩溃,所以我无法获取,不知道它是什么.

I tried to alert the notification.userInfo, but if I access the notification.userInfo, my app will crash, so I can not get it, do not know what it is.

尝试 - 2

我也用 Xcode -> Device 来查找 NSLog 信息,什么也没找到:

I also use Xcode -> Deveice to find the NSLog info, find nothing:

推荐答案

用于调试 UserInfo:将 NSLOG 用于打印 UserInfo 并检查值是否正确.我知道您无法在 Xcode 控制台中检查 NSLOG,但您可以在 Xcode 中的 Devices 选项中检查 NSLOG.Xcode -> Window -> Devices -> 在左侧面板中选择您的设备.您可以在此处查看所有日志.

For Debugging the UserInfo: Put the NSLOG for printing UserInfo and check whether the values are coming correctly. I know you cannot check the NSLOG in Xcode console but you can check the NSLOG in Devices option in Xcode. Xcode -> Window -> Devices -> In the left panel choose your device. Here you can see all your logs.

根据 UserInfo 详细信息,您可以验证您的代码是否正确.

Based on the UserInfo details you can validate your code is correct or not.

这篇关于是否可以在 Xcode 中使用临时配置文件来调试我的应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆