Skip to content

Commit

Permalink
Xcode 11.0 Support (#357)
Browse files Browse the repository at this point in the history
* Xcode 11 WIP

* Some more fixes for Xcode 11
  • Loading branch information
ob authored and oliverhu committed Sep 12, 2019
1 parent bf82215 commit 821dce8
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 14 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ A full list supported options are listed here.

## Requirements

Bluepill only works with **Xcode 10.3**. If you're looking for old Xcode support, please check out the other branches:
Bluepill only works with **Xcode 11.0**. If you're looking for old Xcode support, please check out the other branches:

* [Xcode-8](https://github.com/linkedin/bluepill/tree/xcode8)
* [Xcode-9.0](https://github.com/linkedin/bluepill/tree/xcode-9.0)
Expand All @@ -105,6 +105,7 @@ Bluepill only works with **Xcode 10.3**. If you're looking for old Xcode support
* [Xcode-10.0](https://github.com/linkedin/bluepill/tree/xcode-10.0)
* [Xcode-10.1](https://github.com/linkedin/bluepill/tree/xcode-10.1)
* [Xcode-10.2](https://github.com/linkedin/bluepill/tree/xcode-10.2)
* [Xcode-10.3](https://github.com/linkedin/bluepill/tree/xcode-10.3)

## Acknowledgement

Expand Down
4 changes: 2 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ jobs:
vmImage: macOS-10.14
demands: xcode
steps:
- script: sudo xcode-select -s /Applications/Xcode_10.3.app
displayName: 'Select Xcode 10.3'
- script: sudo xcode-select -s /Applications/Xcode_11.app
displayName: 'Select Xcode 11'
- script: ./scripts/bluepill.sh test
displayName: 'Run BluePill tests'
- task: PublishTestResults@2
Expand Down
6 changes: 3 additions & 3 deletions bp/src/BPConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@

#import <Foundation/Foundation.h>

#define BP_DEFAULT_RUNTIME "iOS 12.4"
#define BP_DEFAULT_DEVICE_TYPE "iPhone 7"
#define BP_DEFAULT_RUNTIME "iOS 13.0"
#define BP_DEFAULT_DEVICE_TYPE "iPhone 8"
#define BP_TM_PROTOCOL_VERSION 17
#define BP_DAEMON_PROTOCOL_VERSION 26
#define BP_DEFAULT_XCODE_VERSION "10.3"
#define BP_DEFAULT_XCODE_VERSION "11.0"
#define BP_MAX_PROCESSES_PERCENT 0.75


Expand Down
2 changes: 1 addition & 1 deletion bp/src/BPSimulator.m
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ - (void)launchApplicationAndExecuteTestsWithParser:(BPTreeParser *)parser andCom
[commandLineArgs addObjectsFromArray:@[
@"-NSTreatUnknownArgumentsAsOpen", @"NO",
@"-ApplePersistenceIgnoreState", @"YES",
@"-XCTIDEConnectionTimeout", @180
@"-XCTIDEConnectionTimeout", @"180"
]];

argsAndEnv[@"args"] = [commandLineArgs copy];
Expand Down
4 changes: 2 additions & 2 deletions bp/src/BPTestBundleConnection.m
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ - (id)_XCT_initializationForUITestingDidFailWithError:(NSError *__strong)errPtr

- (id)_XCT_launchProcessWithPath:(NSString *)path bundleID:(NSString *)bundleID arguments:(NSArray *)arguments environmentVariables:(NSDictionary *)environment
{
NSMutableDictionary *env = [[NSMutableDictionary alloc] init];
NSMutableDictionary<NSString *, NSString *> *env = [[NSMutableDictionary alloc] init];
[env addEntriesFromDictionary:[SimulatorHelper appLaunchEnvironmentWithBundleID:bundleID device:nil config:_config]];
[env addEntriesFromDictionary:environment];
NSDictionary *options = @{
Expand Down Expand Up @@ -255,7 +255,7 @@ - (id)_XCT_getProgressForLaunch:(id)token {

- (id)_XCT_terminateProcess:(id)token {
NSError *error;
kill(self.appProcessPID, SIGKILL);
kill(self.appProcessPID, SIGTERM);
DTXRemoteInvocationReceipt *receipt = [objc_lookUpClass("DTXRemoteInvocationReceipt") new];
[receipt invokeCompletionWithReturnValue:token error:error];
[BPUtils printInfo:DEBUGINFO withString:@"BPTestBundleConnection_XCT_terminateProcess with token %@", token];
Expand Down
8 changes: 4 additions & 4 deletions bp/src/SimulatorHelper.m
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ + (NSDictionary *)appLaunchEnvironmentWithBundleID:(NSString *)hostBundleID
NSMutableDictionary<NSString *, NSString *> *environment = [@{
@"DYLD_FALLBACK_FRAMEWORK_PATH" : [NSString stringWithFormat:@"%@/Library/Frameworks:%@/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks", config.xcodePath, config.xcodePath],
@"DYLD_FALLBACK_LIBRARY_PATH" : [NSString stringWithFormat:@"%@/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib", config.xcodePath],
@"DYLD_INSERT_LIBRARIES" : [NSString stringWithFormat:@"%@/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/Developer/usr/lib/libXCTTargetBootstrapInject.dylib", config.xcodePath],
@"DYLD_INSERT_LIBRARIES" : [NSString stringWithFormat:@"%@/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/Developer/usr/lib/libXCTTargetBootstrapInject.dylib", config.xcodePath],
@"DYLD_LIBRARY_PATH" : [NSString stringWithFormat:@"%@/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks", config.xcodePath],
@"DYLD_ROOT_PATH" : [NSString stringWithFormat:@"%@/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot", config.xcodePath],
@"NSUnbufferedIO" : @YES,
@"OS_ACTIVITY_DT_MODE" : @YES,
@"NSUnbufferedIO" : @"1",
@"OS_ACTIVITY_DT_MODE" : @"1",
@"XCODE_DBG_XPC_EXCLUSIONS" : @"com.apple.dt.xctestSymbolicator",
@"XPC_FLAGS" : @0x0,
@"XPC_FLAGS" : @"0x0",
@"XCTestConfigurationFilePath" : [SimulatorHelper testEnvironmentWithConfiguration:config],
@"__XCODE_BUILT_PRODUCTS_DIR_PATHS" : testSimulatorFrameworkPath,
@"__XPC_DYLD_FRAMEWORK_PATH" : testSimulatorFrameworkPath,
Expand Down
2 changes: 1 addition & 1 deletion bp/tests/SimulatorHelperTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ - (void)testAppLaunchEnvironment {
config.outputDirectory = @"/Users/test/output";
NSDictionary *appLaunchEnvironment = [SimulatorHelper appLaunchEnvironmentWithBundleID:hostBundleId device:nil config:config];
XCTAssert([appLaunchEnvironment[@"DYLD_FALLBACK_FRAMEWORK_PATH"] containsString:@"Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks"]);
XCTAssert([appLaunchEnvironment[@"DYLD_INSERT_LIBRARIES"] containsString:@"Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/Developer/usr/lib/libXCTTargetBootstrapInject.dylib"]);
XCTAssert([appLaunchEnvironment[@"DYLD_INSERT_LIBRARIES"] containsString:@"Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/Developer/usr/lib/libXCTTargetBootstrapInject.dylib"]);
XCTAssert([appLaunchEnvironment[@"DYLD_LIBRARY_PATH"] containsString:@"/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks"]);
XCTAssert([appLaunchEnvironment[@"XCTestConfigurationFilePath"] containsString:@"T/BPSampleAppTests-"]);
XCTAssertEqualObjects(appLaunchEnvironment[@"LLVM_PROFILE_FILE"], @"/Users/test/output/%p.profraw");
Expand Down

0 comments on commit 821dce8

Please sign in to comment.