Skip to content

Commit

Permalink
make sure to use universal binary
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff Haynie committed Mar 24, 2010
1 parent 2e57ef1 commit d930444
Show file tree
Hide file tree
Showing 7 changed files with 1,906 additions and 32 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1 +1,2 @@
build
iphonesim
21 changes: 0 additions & 21 deletions Makefile

This file was deleted.

31 changes: 20 additions & 11 deletions Source/iPhoneSimulator.m
Expand Up @@ -45,7 +45,7 @@ - (void) printUsage {
fprintf(stderr, "Usage: iphonesim <options> <command> ...\n");
fprintf(stderr, "Commands:\n");
fprintf(stderr, " showsdks\n");
fprintf(stderr, " launch <application path> [sdkversion] [family]\n");
fprintf(stderr, " launch <application path> [sdkversion] [family] [uuid]\n");
}


Expand Down Expand Up @@ -86,7 +86,7 @@ - (void) session: (DTiPhoneSimulatorSession *) session didStart: (BOOL) started
/**
* Launch the given Simulator binary.
*/
- (int) launchApp: (NSString *) path withFamily:(NSString*)family {
- (int) launchApp: (NSString *) path withFamily:(NSString*)family uuid:(NSString*)uuid{
DTiPhoneSimulatorApplicationSpecifier *appSpec;
DTiPhoneSimulatorSessionConfig *config;
DTiPhoneSimulatorSession *session;
Expand Down Expand Up @@ -115,15 +115,16 @@ - (int) launchApp: (NSString *) path withFamily:(NSString*)family {

[config setLocalizedClientName: @"TitaniumDeveloper"];

if (family == nil && [config respondsToSelector:@selector(setSimulatedDeviceFamily:)])
{
family = @"iphone";
}

if (family!=nil)
// this was introduced in 3.2 of SDK
if ([config respondsToSelector:@selector(setSimulatedDeviceFamily:)])
{
if (family == nil)
{
family = @"iphone";
}

nsprintf(@"using device family %@",family);

if ([family isEqualToString:@"ipad"])
{
[config setSimulatedDeviceFamily:[NSNumber numberWithInt:2]];
Expand All @@ -134,11 +135,14 @@ - (int) launchApp: (NSString *) path withFamily:(NSString*)family {
}
}


/* Start the session */
session = [[[DTiPhoneSimulatorSession alloc] init] autorelease];
[session setDelegate: self];
[session setSimulatedApplicationPID: [NSNumber numberWithInt: 35]];
if (uuid!=nil)
{
[session setUuid:uuid];
}

if (![session requestStartWithConfig: config timeout: 30 error: &error]) {
nsprintf(@"Could not start simulator session: %@", error);
Expand Down Expand Up @@ -193,11 +197,16 @@ - (void) runWithArgc: (int) argc argv: (char **) argv {

/* Don't exit, adds to runloop */
NSString *family = nil;
NSString *uuid = nil;
if (argc > 4)
{
family = [NSString stringWithUTF8String:argv[4]];
}
[self launchApp: [NSString stringWithUTF8String: argv[2]] withFamily:family];
if (argc > 5)
{
uuid = [NSString stringWithUTF8String:argv[5]];
}
[self launchApp: [NSString stringWithUTF8String: argv[2]] withFamily:family uuid:uuid];
} else {
fprintf(stderr, "Unknown command\n");
[self printUsage];
Expand Down
132 changes: 132 additions & 0 deletions iphonesim.xcodeproj/jhaynie.pbxuser
@@ -0,0 +1,132 @@
// !$*UTF8*$!
{
08FB7793FE84155DC02AAC07 /* Project object */ = {
activeArchitecturePreference = i386;
activeBuildConfigurationName = Release;
activeExecutable = 2481362C115A72C200E3A9BA /* iphonesim */;
activeTarget = 8DD76F960486AA7600D96B5E /* iphonesim */;
addToTargets = (
8DD76F960486AA7600D96B5E /* iphonesim */,
);
codeSenseManager = 2481363C115A72E200E3A9BA /* Code sense */;
executables = (
2481362C115A72C200E3A9BA /* iphonesim */,
);
perUserDictionary = {
PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = {
PBXFileTableDataSourceColumnSortingDirectionKey = "-1";
PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID;
PBXFileTableDataSourceColumnWidthsKey = (
20,
994,
20,
48,
43,
43,
20,
);
PBXFileTableDataSourceColumnsKey = (
PBXFileDataSource_FiletypeID,
PBXFileDataSource_Filename_ColumnID,
PBXFileDataSource_Built_ColumnID,
PBXFileDataSource_ObjectSize_ColumnID,
PBXFileDataSource_Errors_ColumnID,
PBXFileDataSource_Warnings_ColumnID,
PBXFileDataSource_Target_ColumnID,
);
};
PBXPerProjectTemplateStateSaveDate = 291140838;
PBXWorkspaceStateSaveDate = 291140838;
};
perUserProjectItems = {
2481363D115A74B600E3A9BA = 2481363D115A74B600E3A9BA /* PBXTextBookmark */;
2481363E115A74B600E3A9BA = 2481363E115A74B600E3A9BA /* PBXTextBookmark */;
};
sourceControlManager = 2481363B115A72E200E3A9BA /* Source Control */;
userBuildSettings = {
};
};
08FB7796FE84155DC02AAC07 /* iphonesim.m */ = {
isa = PBXFileReference;
fileEncoding = 4;
lastKnownFileType = sourcecode.c.objc;
name = iphonesim.m;
path = /Users/jhaynie/work/iphonesim/iphonesim.m;
sourceTree = "<absolute>";
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {1172, 576}}";
sepNavSelRange = "{0, 0}";
sepNavVisRange = "{0, 234}";
};
};
2481362C115A72C200E3A9BA /* iphonesim */ = {
isa = PBXExecutable;
activeArgIndices = (
);
argumentStrings = (
);
autoAttachOnCrash = 1;
breakpointsEnabled = 0;
configStateDict = {
};
customDataFormattersEnabled = 1;
dataTipCustomDataFormattersEnabled = 1;
dataTipShowTypeColumn = 1;
dataTipSortType = 0;
debuggerPlugin = GDBDebugging;
disassemblyDisplayState = 0;
dylibVariantSuffix = "";
enableDebugStr = 1;
environmentEntries = (
);
executableSystemSymbolLevel = 0;
executableUserSymbolLevel = 0;
libgmallocEnabled = 0;
name = iphonesim;
savedGlobals = {
};
showTypeColumn = 0;
sourceDirectories = (
);
};
2481363B115A72E200E3A9BA /* Source Control */ = {
isa = PBXSourceControlManager;
fallbackIsa = XCSourceControlManager;
isSCMEnabled = 0;
scmConfiguration = {
repositoryNamesForRoots = {
"" = "";
};
};
};
2481363C115A72E200E3A9BA /* Code sense */ = {
isa = PBXCodeSenseManager;
indexTemplatePath = "";
};
2481363D115A74B600E3A9BA /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = 08FB7796FE84155DC02AAC07 /* iphonesim.m */;
name = "iphonesim.m: 1";
rLen = 0;
rLoc = 0;
rType = 0;
vrLen = 234;
vrLoc = 0;
};
2481363E115A74B600E3A9BA /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = 08FB7796FE84155DC02AAC07 /* iphonesim.m */;
name = "iphonesim.m: 1";
rLen = 0;
rLoc = 0;
rType = 0;
vrLen = 234;
vrLoc = 0;
};
8DD76F960486AA7600D96B5E /* iphonesim */ = {
activeExec = 0;
executables = (
2481362C115A72C200E3A9BA /* iphonesim */,
);
};
}

0 comments on commit d930444

Please sign in to comment.