Commit 28341ac3 authored by Vikas Pachdha's avatar Vikas Pachdha

iOS: Removed ios_sim tool source. simctl is used for app deployment on iOS Simulator

Task-number: QTCREATORBUG-16942
Change-Id: Ie50bdfdbf9005e383a2753a3c6081a563a175f61
Reviewed-by: Eike Ziller's avatarEike Ziller <eike.ziller@qt.io>
parent 2b0daf42
TEMPLATE = subdirs
mac {
SUBDIRS += \
iossim \
iossim_1_8_2
}
isEmpty(BUILD_CPLUSPLUS_TOOLS):BUILD_CPLUSPLUS_TOOLS=$$(BUILD_CPLUSPLUS_TOOLS)
!isEmpty(BUILD_CPLUSPLUS_TOOLS): SUBDIRS += cplusplus-keywordgen
Author: Landon Fuller <landonf@plausiblelabs.com>
Copyright (c) 2008-2011 Plausible Labs Cooperative, Inc.
All rights reserved.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
Modifications made by the following entities are licensed as above:
- Jeff Haynie, Appcelerator, Inc.
- https://github.com/hborders
- http://pivotallabs.com/users/scoward/blog
- Eloy Duran, Fingertips <eloy@fngtps.com>
- Fawzi Mohamed, digia <fawzi.mohamed@digia.com>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleExecutable</key>
<string>iossim</string>
<key>CFBundleIdentifier</key>
<string>org.qt-project.qt-creator.iossim</string>
<key>LSUIElement</key>
<string>1</string>
</dict>
</plist>
CONFIG += console
QT -= core
QT -= gui
QT -= test
CONFIG -= app_bundle
include(../../../../qtcreator.pri)
# Prevent from popping up in the dock when launched.
# We embed the Info.plist file, so the application doesn't need to
# be a bundle.
QMAKE_LFLAGS += -Wl,-sectcreate,__TEXT,__info_plist,\"$$PWD/Info.plist\"
-fobjc-link-runtime
LIBS += \
-framework Foundation \
-framework CoreServices \
-framework ApplicationServices \
-framework CoreFoundation \
-F/System/Library/PrivateFrameworks \
-framework IOKit -framework AppKit
iPhoneSimulatorRemoteClientDirectLinking {
LIBS += \
-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks \
-F/Applications/Xcode.app/Contents/OtherFrameworks
LIBS += \
-framework DTViPhoneSimulatorRemoteClient
QMAKE_RPATHDIR += /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks \
/Applications/Xcode.app/Contents/OtherFrameworks \
/System/Library/PrivateFrameworks
}
TEMPLATE = app
# put into a subdir, so we can deploy a separate qt.conf for it
DESTDIR = $$IDE_LIBEXEC_PATH/ios
include(../../../rpath.pri)
OBJECTIVE_SOURCES += \
main.mm \
nsprintf.mm \
nsstringexpandpath.mm \
iphonesimulator.mm
HEADERS += \
iphonesimulator.h \
nsprintf.h \
nsstringexpandpath.h \
version.h \
dvtiphonesimulatorremoteclient/dvtiphonesimulatorremoteclient.h \
coresimulator/coresimulator.h
DISTFILES = IOSSIM_LICENSE \
Info.plist
target.path = $$INSTALL_LIBEXEC_PATH/ios
INSTALLS += target
import qbs 1.0
QtcTool {
name: "iossim"
condition: qbs.targetOS.contains("macos")
Depends { name: "bundle" }
Depends { name: "Qt"; submodules: ["widgets"] }
Depends { name: "app_version_header" }
files: [
"main.mm",
"nsprintf.mm",
"nsstringexpandpath.mm",
"iphonesimulator.mm",
"iphonesimulator.h",
"nsprintf.h",
"nsstringexpandpath.h",
"version.h",
"dvtiphonesimulatorremoteclient/dvtiphonesimulatorremoteclient.h"
]
cpp.includePaths: ["."]
cpp.linkerFlags: base.concat(["-fobjc-link-runtime"])
cpp.frameworks: base.concat(["Foundation", "CoreServices", "ApplicationServices", "IOKit",
"AppKit"])
cpp.frameworkPaths: base.concat("/System/Library/PrivateFrameworks")
bundle.infoPlistFile: "Info.plist"
installDir: qtc.ide_libexec_path + "/ios"
}
/* Author: Landon Fuller <landonf@plausiblelabs.com>
* Copyright (c) 2008-2011 Plausible Labs Cooperative, Inc.
* All rights reserved.
*
* See the IOSSIM_LICENSE file in this directory for the license on the source code in this file.
*/
#import <Foundation/Foundation.h>
#import "dvtiphonesimulatorremoteclient/dvtiphonesimulatorremoteclient.h"
#import "version.h"
@interface iPhoneSimulator : NSObject <DTiPhoneSimulatorSessionDelegate> {
@private
DTiPhoneSimulatorSystemRoot *sdkRoot;
NSFileHandle *stdoutFileHandle;
NSFileHandle *stderrFileHandle;
DTiPhoneSimulatorSession *mySession;
BOOL startOnly;
BOOL exitOnStartup;
BOOL shouldWaitDebugger;
BOOL shouldStartDebugger;
BOOL useGDB;
BOOL verbose;
BOOL alreadyPrintedData;
BOOL retinaDevice;
BOOL tallDevice;
BOOL is64BitDevice;
NSString *deviceTypeId;
NSString *m_stderrPath;
NSString *m_stdoutPath;
NSString *dataPath;
int xcodeVersionInt;
}
- (id)init;
- (void)dealloc;
- (void)runWithArgc:(int)argc argv:(char **)argv;
- (void)createStdioFIFO:(NSFileHandle **)fileHandle ofType:(NSString *)type atPath:(NSString **)path;
- (void)removeStdioFIFO:(NSFileHandle *)fileHandle atPath:(NSString *)path;
- (void)stop;
- (void)doExit:(int)errorCode;
- (SimDevice*) findDeviceWithFamily:(NSString *)family retina:(BOOL)retina isTallDevice:(BOOL)isTallDevice is64Bit:(BOOL)is64Bit;
- (NSString*)changeDeviceType:(NSString *)family retina:(BOOL)retina isTallDevice:(BOOL)isTallDevice is64Bit:(BOOL)is64Bit;
@end
This diff is collapsed.
/* Author: Landon Fuller <landonf@plausiblelabs.com>
* Copyright (c) 2008-2011 Plausible Labs Cooperative, Inc.
* All rights reserved.
*
* See the IOSSIM_LICENSE file in this directory for the license on the source code in this file.
*/
/* derived from https://github.com/phonegap/ios-sim */
#import <AppKit/AppKit.h>
#import <Foundation/NSFileManager.h>
#import "iphonesimulator.h"
/*
* Runs the iPhoneSimulator backed by a main runloop.
*/
int main (int argc, char *argv[]) {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
iPhoneSimulator *sim = [[iPhoneSimulator alloc] init];
/* Execute command line handler */
[sim runWithArgc: argc argv: argv];
/* Run the loop to handle added input sources, if any */
[[NSRunLoop mainRunLoop] run];
[pool release];
return 0;
}
/*
* See the IOSSIM_LICENSE file in this directory for the license on the source code in this file.
*/
int nsvfprintf (FILE *stream, NSString *format, va_list args);
int nsfprintf (FILE *stream, NSString *format, ...);
int nsprintf (NSString *format, ...);
int msgvfprintf (FILE *stream, NSString *format, va_list args);
int msgprintf (NSString *format, ...);
NSString *escapeString(NSString *origString);
/*
* NSLog() clone, but writes to arbitrary output stream
*
* See the IOSSIM_LICENSE file in this directory for the license on the source code in this file.
*/
#import <Foundation/Foundation.h>
#import <stdio.h>
int nsvfprintf (FILE *stream, NSString *format, va_list args) {
int retval;
NSString *str = (NSString *) CFStringCreateWithFormatAndArguments(NULL, NULL, (CFStringRef) format, args);
retval = fprintf(stream, "%s\n", [str UTF8String]);
[str release];
return retval;
}
int nsfprintf (FILE *stream, NSString *format, ...) {
va_list ap;
int retval;
va_start(ap, format);
{
retval = nsvfprintf(stream, format, ap);
}
va_end(ap);
return retval;
}
int nsprintf (NSString *format, ...) {
va_list ap;
int retval;
va_start(ap, format);
{
retval = nsvfprintf(stdout, format, ap);
}
va_end(ap);
return retval;
}
NSString *escapeString(NSString *origString)
{
return [[[[origString stringByReplacingOccurrencesOfString: @"&" withString: @"&amp;"]
stringByReplacingOccurrencesOfString: @"\"" withString: @"&quot;"]
stringByReplacingOccurrencesOfString: @">" withString: @"&gt;"]
stringByReplacingOccurrencesOfString: @"<" withString: @"&lt;"];
}
int msgvfprintf (FILE *stream, NSString *format, va_list args) {
int retval;
NSString *str = (NSString *) CFStringCreateWithFormatAndArguments(NULL, NULL, (CFStringRef) format, args);
retval = fprintf(stream, "<msg>%s</msg>\n", [escapeString(str) UTF8String]);
[str release];
return retval;
}
int msgprintf(NSString *format, ...) {
va_list ap;
int retval;
va_start(ap, format);
{
retval = msgvfprintf(stdout, format, ap);
}
va_end(ap);
return retval;
}
/*
* See the IOSSIM_LICENSE file in this directory for the license on the source code in this file.
*/
#import <Foundation/Foundation.h>
@interface NSString (ExpandPath)
- (NSString *)expandPath;
@end
/*
* See the LICENSE file for the license on the source code in this file.
*/
#import "nsstringexpandpath.h"
@implementation NSString (ExpandPath)
- (NSString *)expandPath {
if ([self isAbsolutePath]) {
return [self stringByStandardizingPath];
} else {
NSString *cwd = [[NSFileManager defaultManager] currentDirectoryPath];
return [[cwd stringByAppendingPathComponent:self] stringByStandardizingPath];
}
}
@end
#define IOS_SIM_VERSION "2.0.1"
Author: Landon Fuller <landonf@plausiblelabs.com>
Copyright (c) 2008-2011 Plausible Labs Cooperative, Inc.
All rights reserved.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
Modifications made by the following entities are licensed as above:
- Jeff Haynie, Appcelerator, Inc.
- https://github.com/hborders
- http://pivotallabs.com/users/scoward/blog
- Eloy Duran, Fingertips <eloy@fngtps.com>
- Fawzi Mohamed, digia <fawzi.mohamed@digia.com>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleExecutable</key>
<string>iossim_1_8_2</string>
<key>CFBundleIdentifier</key>
<string>org.qt-project.qt-creator.iossim_1_8_2</string>
<key>LSUIElement</key>
<string>1</string>
</dict>
</plist>
import qbs 1.0
import QtcTool
QtcTool {
name: "iossim"
condition: qbs.targetOS.contains("macos")
Depends { name: "Qt"; submodules: ["widgets"] }
Depends { name: "app_version_header" }
files: [
"main.mm",
"nsprintf.mm",
"nsstringexpandpath.mm",
"iphonesimulator.mm",
"iphonesimulator.h",
"nsprintf.h",
"nsstringexpandpath.h",
"version.h",
"iphonesimulatorremoteclient/iphonesimulatorremoteclient.h"
]
cpp.linkerFlags: base.concat(["-fobjc-link-runtime"])
cpp.frameworks: base.concat(["Foundation", "CoreServices", "ApplicationServices", "IOKit",
"AppKit"])
cpp.frameworkPaths: base.concat("/System/Library/PrivateFrameworks")
cpp.infoPlistFile: "Info.plist"
toolInstallDir: project.ide_libexec_path + "/ios"
}
CONFIG += console
QT += core
QT += gui
CONFIG -= app_bundle
include(../../../../qtcreator.pri)
# Prevent from popping up in the dock when launched.
# We embed the Info.plist file, so the application doesn't need to
# be a bundle.
QMAKE_LFLAGS += -Wl,-sectcreate,__TEXT,__info_plist,\"$$PWD/Info.plist\" \
-fobjc-link-runtime
LIBS += \
-framework Foundation \
-framework CoreServices \
-framework ApplicationServices \
-framework CoreFoundation \
-F/System/Library/PrivateFrameworks \
-framework IOKit -framework AppKit
iPhoneSimulatorRemoteClientDirectLinking {
LIBS += \
-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks \
-F/Applications/Xcode.app/Contents/OtherFrameworks
LIBS += \
-framework iPhoneSimulatorRemoteClient
QMAKE_RPATHDIR += /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks \
/Applications/Xcode.app/Contents/OtherFrameworks
/System/Library/PrivateFrameworks \
}
TEMPLATE = app
# put into a subdir, so we can deploy a separate qt.conf for it
DESTDIR = $$IDE_LIBEXEC_PATH/ios
include(../../../rpath.pri)
OBJECTIVE_SOURCES += \
main.mm \
nsprintf.mm \
nsstringexpandpath.mm \
iphonesimulator.mm
HEADERS += \
iphonesimulator.h \
nsprintf.h \
nsstringexpandpath.h \
version.h \
iphonesimulatorremoteclient/iphonesimulatorremoteclient.h
DISTFILES = IOSSIM_LICENSE \
Info.plist
target.path = $$INSTALL_LIBEXEC_PATH/ios
INSTALLS += target
/* Author: Landon Fuller <landonf@plausiblelabs.com>
* Copyright (c) 2008-2011 Plausible Labs Cooperative, Inc.
* All rights reserved.
*
* See the IOSSIM_LICENSE file in this directory for the license on the source code in this file.
*/
#import <Foundation/Foundation.h>
#import "iphonesimulatorremoteclient/iphonesimulatorremoteclient.h"
#import "version.h"
@interface iPhoneSimulator : NSObject <DTiPhoneSimulatorSessionDelegate> {
@private
DTiPhoneSimulatorSystemRoot *sdkRoot;
NSFileHandle *stdoutFileHandle;
NSFileHandle *stderrFileHandle;
DTiPhoneSimulatorSession *session;
NSTimer *pidCheckingTimer;
BOOL startOnly;
BOOL exitOnStartup;
BOOL shouldWaitDebugger;
BOOL shouldStartDebugger;
BOOL useGDB;
BOOL verbose;
BOOL alreadyPrintedData;
BOOL retinaDevice;
BOOL tallDevice;
}
- (id)init;
- (void)dealloc;
- (void)runWithArgc:(int)argc argv:(char **)argv;
- (void)createStdioFIFO:(NSFileHandle **)fileHandle ofType:(NSString *)type atPath:(NSString **)path;
- (void)removeStdioFIFO:(NSFileHandle *)fileHandle atPath:(NSString *)path;
- (void)stop;
- (void)checkPid:(NSTimer *)timer;
- (void)doExit:(int)errorCode;
- (void)changeDeviceType:(NSString *)family retina:(BOOL)retina isTallDevice:(BOOL)isTallDevice;
@end
This diff is collapsed.
#import <Cocoa/Cocoa.h>
/*
* File: /Developer/Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks/iPhoneSimulatorRemoteClient.framework/Versions/A/iPhoneSimulatorRemoteClient
* Arch: Intel 80x86 (i386)
* Current version: 12.0.0, Compatibility version: 1.0.0
*
* See the IOSSIM_LICENSE file in the parent directory for the license on the source code in this file.
*/
@class DTiPhoneSimulatorSession;
@protocol DTiPhoneSimulatorSessionDelegate
- (void) session: (DTiPhoneSimulatorSession *) session didEndWithError: (NSError *) error;
- (void) session: (DTiPhoneSimulatorSession *) session didStart: (BOOL) started withError: (NSError *) error;
@end
@interface DTiPhoneSimulatorApplicationSpecifier : NSObject <NSCopying>
{
NSString *_appPath;
NSString *_bundleID;
}
+ (id) specifierWithApplicationPath: (NSString *) appPath;
+ (id) specifierWithApplicationBundleIdentifier: (NSString *) bundleID;
- (NSString *) bundleID;
- (void) setBundleID: (NSString *) bundleId;
- (NSString *) appPath;
- (void) setAppPath: (NSString *) appPath;
@end
@interface DTiPhoneSimulatorSystemRoot : NSObject <NSCopying>
{
NSString *sdkRootPath;
NSString *sdkVersion;
NSString *sdkDisplayName;
}
+ (id) defaultRoot;
+ (id)rootWithSDKPath:(id)fp8;
+ (id)rootWithSDKVersion:(id)fp8;
+ (NSArray *) knownRoots;
- (id)initWithSDKPath:(id)fp8;
- (id)sdkDisplayName;
- (void)setSdkDisplayName:(id)fp8;
- (id)sdkVersion;
- (void)setSdkVersion:(id)fp8;
- (id)sdkRootPath;
- (void)setSdkRootPath:(id)fp8;
@end
@interface DTiPhoneSimulatorSessionConfig : NSObject <NSCopying>
{
NSString *_localizedClientName;
DTiPhoneSimulatorSystemRoot *_simulatedSystemRoot;
DTiPhoneSimulatorApplicationSpecifier *_applicationToSimulateOnStart;
NSArray *_simulatedApplicationLaunchArgs;
NSDictionary *_simulatedApplicationLaunchEnvironment;
BOOL _simulatedApplicationShouldWaitForDebugger;
NSString *_simulatedApplicationStdOutPath;
NSString *_simulatedApplicationStdErrPath;
}
- (id)simulatedApplicationStdErrPath;
- (void)setSimulatedApplicationStdErrPath:(id)fp8;
- (id)simulatedApplicationStdOutPath;
- (void)setSimulatedApplicationStdOutPath:(id)fp8;
- (id)simulatedApplicationLaunchEnvironment;
- (void)setSimulatedApplicationLaunchEnvironment:(id)fp8;
- (id)simulatedApplicationLaunchArgs;
- (void)setSimulatedApplicationLaunchArgs:(id)fp8;
- (DTiPhoneSimulatorApplicationSpecifier *) applicationToSimulateOnStart;
- (void) setApplicationToSimulateOnStart: (DTiPhoneSimulatorApplicationSpecifier *) appSpec;
- (DTiPhoneSimulatorSystemRoot *) simulatedSystemRoot;
- (void) setSimulatedSystemRoot: (DTiPhoneSimulatorSystemRoot *) simulatedSystemRoot;
- (BOOL) simulatedApplicationShouldWaitForDebugger;
- (void) setSimulatedApplicationShouldWaitForDebugger: (BOOL) waitForDebugger;
- (id)localizedClientName;
- (void)setLocalizedClientName:(id)fp8;
// Added in 3.2 to support iPad/iPhone device families
- (void)setSimulatedDeviceFamily:(NSNumber*)family;
@end
@interface DTiPhoneSimulatorSession : NSObject {
NSString *_uuid;
id <DTiPhoneSimulatorSessionDelegate> _delegate;
NSNumber *_simulatedApplicationPID;
int _sessionLifecycleProgress;
NSTimer *_timeoutTimer;
DTiPhoneSimulatorSessionConfig *_sessionConfig;
struct ProcessSerialNumber _simulatorPSN;
}
- (BOOL) requestStartWithConfig: (DTiPhoneSimulatorSessionConfig *) config timeout: (NSTimeInterval) timeout error: (NSError **) outError;
- (void) requestEndWithTimeout: (NSTimeInterval) timeout;
- (id)sessionConfig;
- (void)setSessionConfig:(id)fp8;
- (id)timeoutTimer;
- (void)setTimeoutTimer:(id)fp8;
- (int)sessionLifecycleProgress;
- (void)setSessionLifecycleProgress:(int)fp8;
- (id)simulatedApplicationPID;
- (void)setSimulatedApplicationPID:(id)fp8;
- (id<DTiPhoneSimulatorSessionDelegate>) delegate;
- (void) setDelegate: (id<DTiPhoneSimulatorSessionDelegate>) delegate;
- (id)uuid;
- (void)setUuid:(id)fp8;
@end
/* Author: Landon Fuller <landonf@plausiblelabs.com>
* Copyright (c) 2008-2011 Plausible Labs Cooperative, Inc.
* All rights reserved.
*
* See the IOSSIM_LICENSE file in this directory for the license on the source code in this file.
*/
/* derived from https://github.com/phonegap/ios-sim */
#import <AppKit/AppKit.h>
#import "iphonesimulator.h"
#include <QLibrary>
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
#include <QApplication>
#else
#include <QGuiApplication>
#endif
#include <QString>
#include <QStringList>
/* to do: