现在大概了解该怎么做了但是问题又来了。。在导出私有api的时候,用了class-dump和DumpFrameworks.pl。 结果在目标文件夹Headers里生成的框架文件夹都是空的或者全都是CDStructures.h,这些头文件里面也没有实际内容。下面是DumpFrameworks.pl的内容。#!/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) - $!"; } }
结果在目标文件夹Headers里生成的框架文件夹都是空的或者全都是CDStructures.h,这些头文件里面也没有实际内容。下面是DumpFrameworks.pl的内容。#!/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) - $!";
}
}
直接用 iPhoneOS.platform路径导出文件夹里面都是空的,用模拟器的路径可以导出,但是我需要的MobileWiFi.framework模拟器里面并不存在,那怎么办。。