harrylin652 2015-02-04 08:43 采纳率: 0%
浏览 2594

ios8.1 的sdk 使用classdump和dumpframeworks以后遇到了问题

在生成的headers文件夹下,里面各个框架只生成了文件夹,或者是只生成了CDstructures.h文件,但是这些文件全是空的。
请教大神。。是怎么回事

 #!/usr/bin/perl
#
# 24 November 2008
# Framework Dumping utility; requires class-dump
#

use strict;

use Cwd;
use File::Path;

my $HOME = (getpwuid($<))[7] || $ENV{'HOME'}
or die "Could not find your home directory!";

# This command must be in your path.
# http://www.codethecode.com/projects/class-dump/
my $CLASS_DUMP = 'class-dump';

# 这里路径需要小心,后面像别名一样的东东需要换行的

# Public Frameworks
dump_frameworks('/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/System/Library/Frameworks',
'Frameworks');

# Private Frameworks
dump_frameworks('/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/System/Library/PrivateFrameworks',
'PrivateFrameworks');

sub dump_frameworks
{
    my($dir, $subdir) = @_;

    opendir(my $dirh, $dir) or die "Could not opendir($dir) - $!";

    # Iterate through each framework found in the directory
    foreach my $file (grep { /\.framework$/ } readdir($dirh))
    {
        # Extract the framework name
        (my $fname = $file) =~ s/\.framework$//;
        print "Framework: $fname\n";

        my $headers_dir = "$HOME/Headers/$subdir/$fname";

        # Create the folder to store the headers
        mkpath($headers_dir);

        # Perform the class-dump
        my $cwd = cwd();
        chdir($headers_dir) or die "Could not chdir($headers_dir) - $!";

        system($CLASS_DUMP, '-H', "$dir/$file");

        if($? == -1)
        {
            die "Could not execute $CLASS_DUMP - $!\n";
        }

        chdir($cwd) or die "Could not chdir($cwd) - $!";
    }
}

以上是DumpFrameworks.pl的内容

  • 写回答

2条回答 默认 最新

  • jun1987929 2015-10-14 16:47
    关注

    谢谢你的脚本。我改了下:

    dump_frameworks('/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.4.sdk/System/Library/Frameworks',
    'Frameworks');
    dump_frameworks('/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.4.sdk/System/Library/PrivateFrameworks',
    'PrivateFrameworks');

    这样就可以了。

    评论

报告相同问题?

悬赏问题

  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料
  • ¥15 使用R语言marginaleffects包进行边际效应图绘制
  • ¥20 usb设备兼容性问题
  • ¥15 错误(10048): “调用exui内部功能”库命令的参数“参数4”不能接受空数据。怎么解决啊
  • ¥15 安装svn网络有问题怎么办
  • ¥15 vue2登录调用后端接口如何实现