加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

我可以调试从IPA存档安装的iOS应用吗?

发布时间:2020-12-15 01:49:18 所属栏目:百科 来源:网络整理
导读:我的应用程序有一些问题,只有当我安装它时才会重现,但如果我只是从Xcode运行应用程序,则无法重现.我想调试这个问题,但到目前为止我没有运气.我正在使用Xcode 5.1.1.这是我做的: 1) Go to Product-Scheme-Edit Scheme-Archive and set build configuration t
我的应用程序有一些问题,只有当我安装它时才会重现,但如果我只是从Xcode运行应用程序,则无法重现.我想调试这个问题,但到目前为止我没有运气.我正在使用Xcode 5.1.1.这是我做的:

1) Go to Product->Scheme->Edit Scheme->Archive and set build
configuration to Debug.

2) Code signing identity is set to iPhone Developer.

3) Generate Debug Symbols is set to Yes.

4) Go to Product->Archive and after it is archived,click
“Distribute”,then choose “Save for Enterprise or Ad Hoc Deployment”.

5) My development provisioning profile is selected.

6) Click “Export” and export the .ipa file.

7) Use iPhone configuration Utility to install the app onto the
device.

8) Run the app on the device.

9) In Xcode,go to Debug->Attach To Process->By PID or Name,enter the
app name. Xcode attaches successfully and says running the app on
iPad.

10) However,i cannot hit any breakpoints which should be hit when i
do certain actions in my app (if i install and run the app from Xcode
instead,all breakpoints are hit).

我错过了什么吗?

解决方法

此时您还没有针对该应用程序的任何调试信息,并且由于大多数应用程序都被彻底剥离,因此lldb甚至不会挂起符号.所以我们无法成功设置断点.

当您构建应用程序时,Xcode生成了一个dSYM文件(MyApp.app.dSYM),其中包含调试信息,因此所有文件都不会丢失.问题是当你在设备上附加一些 – Xcode – 随机应用程序时,Xcode无法知道在哪里可以找到它的调试信息.

您可以使用以下命令将调试信息添加到lldb中的调试会话中:

(lldb) add-dsym <PathTo.dSYM>

附加后必须这样做.

lldb还使用SpotLight来查找dSYM,所以如果你将dSYM放在SpotLight知道要搜索的地方(比如桌面或用户目录下的文件夹),那么lldb应该自动选择它.

您可以通过执行以下操作来判断lldb是否已成功读取dSYM:

(lldb) image list <AppName>

如果lldb找到了dSYM,它会在列出AppName二进制文件的路径后在单独的行中列出它的路径.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读