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个回答

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

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');

这样就可以了。

请问一下,你的只有CDstructures.h文件是怎么解决的

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐