Граф коммитов

1066 Коммитов

Автор SHA1 Сообщение Дата
Lawrence Lomax 7b359005b1 Bypass Loading of User Plugins
Summary: User plugins, which are plugins at `~/Library/Application Support/Developer/Shared/Xcode/Plug-ins`, can cause issues if linked into the same image as a process that already references the same symbols. In order to save time and prevent runtime linker issues it makes sense to bypass the loading of these symbols. The simplest way of doing this is swizzling the bundle loader method and log/no-op in the event we have one of these bundles.

Reviewed By: mmmulani

Differential Revision: D3392950

fbshipit-source-id: cf173c8bd548d2b26d8cbc4dbb27d226582bf036
2016-06-06 10:47:47 -07:00
Lawrence Lomax f5b3f2d6a5 Move Framework configuration to xcconfig
Summary: This slipped through the net in the `xcconfig` move. Should help compare settings between the four main Frameworks

Reviewed By: marekcirkos

Differential Revision: D3391969

fbshipit-source-id: 3e3f540d0d899925a8211a64bcae98c6412e54e0
2016-06-06 04:49:12 -07:00
Lawrence Lomax 5dd36acb09 Make FBDeviceControl Framework a Module
Summary: This allows `FBDeviceControl` to be embedded in swift Framework targets.

Reviewed By: marekcirkos

Differential Revision: D3391967

fbshipit-source-id: f6962410783490b4a707ba3732fb14e4b837c142
2016-06-06 04:49:11 -07:00
Lawrence Lomax fdde2af7a6 Expose Device/Simulator configuration in FBiOSTarget
Summary: This will allow Devices and Simulators to have a common formattable as well as share the class-cluster of configuration.

Reviewed By: marekcirkos

Differential Revision: D3391965

fbshipit-source-id: acc6e066a614cf0b01aef207cfa66ac1c4d4a396
2016-06-06 04:49:11 -07:00
Lawrence Lomax a4ad909b35 Make Variant Classes Public on FBSimulatorConfiguration
Summary: These are part of `FBControlCore` and are important for defining configuration. Making them public allows consumers of the configuration obtain information about available architectures for a Simulator.

Reviewed By: marekcirkos

Differential Revision: D3384607

fbshipit-source-id: 34c447754198aea6b07ffa46ef9aea0a49a22a21
2016-06-03 03:34:31 -07:00
Lawrence Lomax 7295dc45da Move FBSimulatorQuery to FBiOSTargetQuery
Summary: By moving `FBSimulatorQuery`'s model to `FBControlCore` it's possible for `FBDeviceControl` to then use a query for fetching. The only leakage of Simulators back to `FBControlCore` is the State enumeration. In future I may want to consolidate this with Device states.

Reviewed By: marekcirkos

Differential Revision: D3384602

fbshipit-source-id: 6f3ac5282dc8b94f2f3c458a8e9695d317aab4ce
2016-06-03 03:34:31 -07:00
Lawrence Lomax cde5be8b46 Add Compatible Simulator Archs
Summary: In the same way that we have the archs of valid Device binaries, we can have the same for Simulators given that iPhone 5s and later started allowing 64-bit executables.

Reviewed By: marekcirkos

Differential Revision: D3384593

fbshipit-source-id: 11b6266915bafbb2275c51241051fccb4fa6fd18
2016-06-03 03:34:31 -07:00
Lawrence Lomax 6bf097e6ea Move Target-Specific Setting to xcconfig
Summary: `FBControlCore` has some target-specific setting that can be extracted to the truly wonderful world of human editable text files.

Reviewed By: marekcirkos

Differential Revision: D3371032

fbshipit-source-id: 952995d4358ae2e5e8e713659992128da1a9fcc9
2016-06-02 14:04:17 -07:00
Lawrence Lomax 6f9160ff21 Move Target-Specific settings to xcconfig
Summary: There are a few relevant target-specifc settings that we can move to the magical world of plaintext.

Reviewed By: marekcirkos

Differential Revision: D3371030

fbshipit-source-id: c368f0228fcb0f1acbddef6650d8ec0413cc234c
2016-06-02 14:04:17 -07:00
Lawrence Lomax 1382eafba2 Move Target Specific Settings to xcconfig
Summary: Moves target-Specific settings for `FBDeviceControl` and `FBDeviceControlTests` to `xcconfig` files

Reviewed By: marekcirkos

Differential Revision: D3371027

fbshipit-source-id: 725dcc3bea2edd914d5f7002740fd2d0782bfef9
2016-06-02 14:04:16 -07:00
Lawrence Lomax 837c0f5fc8 Move Deployment settings to xcconfig
Summary: These are yet again duplicate at the target level, so pulling these back to the `xcconfig`

Reviewed By: marekcirkos

Differential Revision: D3371024

fbshipit-source-id: ee1a0382ae75f61108b23b8ba4ce335f78974083
2016-06-02 14:04:16 -07:00
Lawrence Lomax e5b1e4b57d Use SimDeviceSet in FBSimulatorSet rather than -[SimDevice deviceSet]
Summary: On Xcode 7.2, the `SimDevice` doesn't contain a reference to it's `SimDeviceSet`. Since we have a strong reference to this in `FBSimulatorSet` we should use this instead. Otherwise the `deleteSimulator:` method will fail since the set is `nil`.

Reviewed By: asm89

Differential Revision: D3379576

fbshipit-source-id: dfb6be4253aaf261f987817bdd75311b3cad3213
2016-06-02 10:35:21 -07:00
Lawrence Lomax a7edf402fb Move Build options from target to project
Summary: These are varied per-configuration (Debug/Release) instead of per-target, so I'm leaving them at the project level for now and instead removing them at the target level.

Reviewed By: marekcirkos

Differential Revision: D3371021

fbshipit-source-id: af5f9069f450477d8c3cf2efa39a536b545e6493
2016-06-02 08:49:09 -07:00
Lawrence Lomax cd90bc41f7 Remove CODE_SIGN_IDENTITY
Summary: This is yet again shared between targets, and not even needed. We just need to appease the Xcode Framework codesign warning

Reviewed By: marekcirkos

Differential Revision: D3371018

fbshipit-source-id: c402ffb07831b95a42e83b356bd6bfa71261d362
2016-06-02 08:49:09 -07:00
Lawrence Lomax a5d97660d9 Move Preprocessor build settings to xcconfig
Summary: Moves out target-duplicated Preprocessor settings to the `Shared.xcconfig`

Reviewed By: marekcirkos

Differential Revision: D3371016

fbshipit-source-id: bc4edd75680e03d3b05140e20ca472bd3c239452
2016-06-02 08:49:08 -07:00
Lawrence Lomax 6453b80216 Add CPU Architechtures for Devices
Summary: Knowing the available architechtures for a given device configuration is important to identify whether an Application can be installed on a device. All of this configuration is static, we can just add the archs to configurations over time and as new devices are released.

Reviewed By: marekcirkos

Differential Revision: D3378183

fbshipit-source-id: 80c44d9aff1a1267ff338db1b2d1df37892543b8
2016-06-02 03:34:19 -07:00
Lawrence Lomax 744d0767ae Derive ProductName from ProductType
Summary: Apple uses names like `iPhone8,1` to mean 'iPhone 6s'. These can be mapped to their more appropriate names so long as we have the configuration in the Framework. The Configuration Variants that `FBSimulatorControl` has used for determining parameters for `CoreSimulator` can have additional propreties added to expose these model identifiers.

Reviewed By: marekcirkos

Differential Revision: D3372419

fbshipit-source-id: 13ad7af4f5600b12f653b86ef522ab15b488456d
2016-06-02 03:34:19 -07:00
Lawrence Lomax 1b24e9289f Use iOS/Device Configuration Class-Cluster to FBControlCore
Summary: Moving this to `FBControlCore` will allow `FBDeviceControl` to augment elements within the class cluster, with model device ids from `MobileDevice.framework`. These can be used to map a variety of strings and identifiers to configurations for a device/simulator

Reviewed By: marekcirkos

Differential Revision: D3378176

fbshipit-source-id: 46cac9dc4055865801547055b7f206a53a8c4265
2016-06-02 03:34:19 -07:00
Lawrence Lomax be758780c5 C/C++/Objective-C Language Standards
Summary: C/C++ Langugage Standard, plus global enabling of Objective-C ARC

Reviewed By: migchez

Differential Revision: D3371015

fbshipit-source-id: f6666dd96cfb08df8eaa00a1f6baae0631ba72df
2016-06-02 02:19:32 -07:00
Lawrence Lomax b7449a2df2 Move SDKROOT & MACOSX_DEPLOYMENT_TARGET to xcconfig
Summary: Pegs these as global for all Frameworks, in one convenient location!

Reviewed By: marekcirkos

Differential Revision: D3371013

fbshipit-source-id: 29d77b8935d4e9d20fb400af7aefeabac42bb1a7
2016-06-02 02:19:32 -07:00
Lawrence Lomax 104ac631f8 Move OTHER_LDFLAGS to `xcconfig`
Summary: Moving more to `xcconfig` files for readability, editability and source control tracking.

Reviewed By: marekcirkos

Differential Revision: D3371012

fbshipit-source-id: 5432bb6c5357615a5352004cdeadfc81bea66c0b
2016-06-02 02:19:32 -07:00
Lawrence Lomax ccf2f71219 Extract Simulator OTHER_LDFLAGS to `xcconfig`
Summary: `FBSimulatorControl` hides the intracacies of `CoreSimulator` behind it's API, so the weak-linking of these Frameworks can be restricted to `FBSimulatorControl` alone.

Reviewed By: marekcirkos

Differential Revision: D3371009

fbshipit-source-id: 34ece3907bb1eb41202bd347bd2666fea918c545
2016-06-02 02:19:32 -07:00
Lawrence Lomax c8dbdcb826 Move Framework/Header Search paths to config
Summary: Extracts the flags that are provided to the linker to the `xcconfig` file so that the `pbxproj` is trimmed down.

Reviewed By: marekcirkos

Differential Revision: D3366469

fbshipit-source-id: a87149865b37f79ebeca7bdd6ab63ff805371a5d
2016-06-02 02:19:32 -07:00
Lawrence Lomax 63719bf668 Get more Properties from MobileDevice
Summary: There are few more Properties that can be resolved from `MobileDevice` instead of `DVTFoundation` and associated plugins, we should use those

Reviewed By: mmmulani

Differential Revision: D3339826

fbshipit-source-id: 194648c4fb38865c7ad4602109ad052c5c51d7ce
2016-06-01 10:19:22 -07:00
Lawrence Lomax 1ee8ff7e2d Remove Duplicate Compiler Warnings from pbxproj
Summary: These are all inherited from the `xcconfig`, so there's no need for these to be re-declared in the project itself.

Reviewed By: marekcirkos

Differential Revision: D3365235

fbshipit-source-id: 51bda23ab1427f92cc9b7be4715bbbeb667a92d2
2016-05-31 07:04:22 -07:00
Lawrence Lomax 8d284478bf Move Shared Configuration to it's own Config
Summary: Instead of the copypasta of the `xcconfig` files, it makes more sense to move these definitions to a shared configuration, which is then `#include`d from the other configurations. The configuration that is currently in the `FBSimulatorControl.xcodeproj/project.pbxproject` can then be extracted out to the per-target files. This can aid migration to GitHub buck builds and possibly a public workspace instead of a massive project.

Reviewed By: marekcirkos

Differential Revision: D3365232

fbshipit-source-id: b8234da1abff44c8525d9298599d632dba928fa2
2016-05-31 07:04:22 -07:00
Lawrence Lomax 66c797e414 Fix the ALWAYS_SEARCH_USER_PATHS warning
Summary:
There's a build warning as `ALWAYS_SEARCH_USER_PATHS` is set to `YES`. This apparently conficts with the `DEFINES_MODULE` setting:

```
Warning: using 'ALWAYS_SEARCH_USER_PATHS = YES' while building targets which define modules ('DEFINES_MODULE = YES') may fail. Please migrate to using 'ALWAYS_SEARCH_USER_PATHS = NO'.
``

Reviewed By: marekcirkos

Differential Revision: D3365231

fbshipit-source-id: bce03f42a75f8014d55586fefa01a85db0d59876
2016-05-31 07:04:22 -07:00
Lawrence Lomax 2a239d81f9 Add Bulk Kill/Erase/Delete Methods
Summary: Exposing Bulk erase/kill/delete methods completes the `FBSimulatorSet` API and will allow for the optimisation of the strategies these operations depend on. For example, deletion can be sped up in bulk by killing multiple Simulators at the same time and then waiting for `CoreSimulator` to show the state change before deleting.

Reviewed By: marekcirkos

Differential Revision: D3365230

fbshipit-source-id: 52d11460abb42ef8aaf930d739f3b1fe4c8b3869
2016-05-31 07:04:22 -07:00
Lawrence Lomax d195e8b456 Check for set membership in FBSimulatorTerminationStrategy
Summary: Moving this check into the strategy means that the caller doesn't have to. Also simplifies object construction.

Reviewed By: marekcirkos

Differential Revision: D3365228

fbshipit-source-id: 4f39a5bf9b24d89fa5d3019b03c57e65bee74730
2016-05-31 07:04:22 -07:00
Lawrence Lomax 32d35e7930 Move Erasing Simulator membership check into Strategy
Summary: The Strategy is specialised to understand how erasing works. Moving membership checks here means that the caller doesn't have to concern itself with these checks.

Reviewed By: marekcirkos

Differential Revision: D3365226

fbshipit-source-id: b41c177d5c5b1418b0c0db380a086dfc16d9485b
2016-05-31 07:04:22 -07:00
Lawrence Lomax 2c481bcff7 Get Deletion logger arg from Simulator Set
Summary: The Constructor can get the logger ref instead of the constructor caller

Reviewed By: migchez

Differential Revision: D3360019

fbshipit-source-id: fe891c518acf4491c467573a94381240d4bdae5a
2016-05-31 02:04:08 -07:00
Lawrence Lomax a738314dd4 Don't erase before deletion
Summary: This can appear to result in some occasions where files will still be open from the erase which then cause the deletion to fail. It's far simpler to delete the Simulator and just delete the log directory after the fact.

Reviewed By: nqmtuan

Differential Revision: D3358515

fbshipit-source-id: 4c927fb6a1b3264f6f51e3a83b5ca40b999294af
2016-05-27 08:34:05 -07:00
Lawrence Lomax 8b8df0fe9f Erase simulators before deleting them
Summary: Erasing before deletion is a wise move as it will also catch the substantial number of logfiles that deletion does not located in `~/Library/Logs/CoreSimulator/<UDID>`. This will ensure these hefty logs aren't left lying around when you really wish to obliterate a Simulator.

Reviewed By: nqmtuan

Differential Revision: D3352817

fbshipit-source-id: e3776766699668a561076f890a0482adb0d8ffb3
2016-05-26 10:04:13 -07:00
Lawrence Lomax 6b63b4b040 Add brief README
Summary: `FBDeviceControl` is very experimental, let's add a `README` to highlight this

Reviewed By: marekcirkos

Differential Revision: D3352345

fbshipit-source-id: 55a4c8db73d066a92e051b9390625e0afbd32c0f
2016-05-26 05:19:26 -07:00
Lawrence Lomax 7175c71f9d Add Accessor for CoreSimulator Logs Directory
Summary: This contains a lot of interesting goodies, so it's handy to have as a public API. Additionally, these Logs have a tendency to accumilate so may need to be erased.

Reviewed By: marekcirkos

Differential Revision: D3352228

fbshipit-source-id: 3f6d38b7309dc1e961c883a3cf77f3f9ff014f19
2016-05-26 02:49:06 -07:00
Lawrence Lomax 4b054fadcf Update Copyright notices
Summary: Mistakes and Artifacts from pre-oss.

Reviewed By: marekcirkos

Differential Revision: D3352230

fbshipit-source-id: 5d0303f64915be83bbdbe316df8fd449ef9dcd6b
2016-05-26 02:36:57 -07:00
Lawrence Lomax fc2a0cf551 Add Logging defaults for FBDeviceControlTests
Summary: `FBSimulatorControl` includes logs as they are pretty helpful when running tests, `FBDeviceControl` can do the same.

Reviewed By: mmmulani

Differential Revision: D3339825

fbshipit-source-id: bce3a73e6fccc313704a370246f7d3b1d55f8924
2016-05-26 02:36:57 -07:00
Lawrence Lomax 14ad9237b3 Two-Stage Framework Initialization
Summary: The loading 'Xcode Frameworks' can be deferred until they are needed, allowing certain APIs to be used without requiring loading these Frameworks at all. Splitting the initialization defers expensive Framework loading until it is actually needed. The `DVT` classes are also loaded from the Device Set lazily since we need to 'prime' the device set in order to obtain valid devices from it.

Reviewed By: mmmulani

Differential Revision: D3339824

fbshipit-source-id: fbea89c5934c5517071aa38d19b17f8d782a9d49
2016-05-26 02:36:57 -07:00
Lawrence Lomax 5d2b911358 Improve ConfigurationUtilityKit Framework loading
Summary: Adds explicit dependency on the `ConfigurationProfile` Framework.

Reviewed By: mmmulani

Differential Revision: D3339823

fbshipit-source-id: e1580d4f64e80ada777268988b2318325792718f
2016-05-26 02:36:57 -07:00
Lawrence Lomax 64cdba0a06 Lazily Fetch DVTiOSDevice
Summary: It will be possible to bypass using the `DVT` classes for some subset of public API. By deferring the usage of the `DVT` classes, we can later defer the linking of these classes.

Reviewed By: mmmulani

Differential Revision: D3339822

fbshipit-source-id: 3bd9a98077be8b722559518ea7b606815039aae0
2016-05-26 02:36:57 -07:00
Lawrence Lomax caa521e5f4 Add Device Name Fetching
Summary: The UDID and Name are somewhat confusing. The Name is the Name of the Device specified by the user, the UDID is obviously unique. Also adds the function prototypes to the header.

Reviewed By: marekcirkos

Differential Revision: D3334170

fbshipit-source-id: cd80292556c9e8479aa6d995961e80c57f5bddc8
2016-05-26 02:36:56 -07:00
Lawrence Lomax 8ad2441aee Slightly improve some logging
Summary: Use Strings instead of UDID objects. Add information about daemon code paths.

Reviewed By: marekcirkos, migchez

Differential Revision: D3346716

fbshipit-source-id: a50be5f8a2fd82dc9d1faa603587271fe79ef90e
2016-05-25 09:19:07 -07:00
Lawrence Lomax 351ad1c4bf Improve State logging for FBTestDaemonConnection
Summary: There are a number of states that could use further logging in order to trace the ordering of events in the event of a failure.

Reviewed By: nqmtuan

Differential Revision: D3341312

fbshipit-source-id: 16bff9e61f869968b58bccf5d1a7558a4188b2a3
2016-05-25 02:34:08 -07:00
Lawrence Lomax 2b4ca35a5b Fuller state transitions in FBTestBundleConnection
Summary: Improves the state transitions inside `FBTestBundleConnection` by providing separate error and success conditions. The 'Connecting' state was never set, which needs fixing. Some of the logging inside `FBTestBundleConnection` was a little lacking.

Reviewed By: nqmtuan

Differential Revision: D3341203

fbshipit-source-id: 33bdf82ab127f0b3aa082ae084c55c58512314c4
2016-05-25 02:34:08 -07:00
Lawrence Lomax 533ea82a68 Return inner error for uncategorized Framework load failure
Summary: Currently the underlying error from Framework errors are ignored if the error cannot be categorized. This fixes that.

Reviewed By: mmmulani

Differential Revision: D3339820

fbshipit-source-id: c8361c0de5d0b744a62823a8c394c90233550d91
2016-05-24 04:49:02 -07:00
Lawrence Lomax fb5be5a9f5 Allow overriding of Locale/Language on App Launch
Summary:
It's possible to pass `NSUserDefaults` on the Command Line instead of setting globally for the whole Simulator.

Using a model to represent ways of setting the arguments via a defaults plist and other arguments. If we decide to later, we may be able to add additional configurable overrides for keyboards etc.

Reviewed By: marekcirkos

Differential Revision: D3328191

fbshipit-source-id: 37688698880aa33210f26f8e9581d1f90228dd00
2016-05-23 00:49:08 -07:00
Johannes Plunien a21413a86a Fix setting up test connection on iOS 8 simulators
Summary:
Fix #263

Please let me know if I can improve something. Please see also my comments in #263 about the retrying strategy of Xcode. Once you "listen" to the `XPC` communication, you'll notice that Xcode is also just trying different methods and ignoring errors.
Closes https://github.com/facebook/FBSimulatorControl/pull/264

Differential Revision: D3333334

Pulled By: marekcirkos

fbshipit-source-id: a14faff8828e3896577fa8be58395de9a0935268
2016-05-22 02:34:03 -07:00
Johannes Plunien 868d9967f8 Fix typo in notification name
Summary: Closes https://github.com/facebook/FBSimulatorControl/pull/265

Differential Revision: D3333323

Pulled By: marekcirkos

fbshipit-source-id: 28af942b077b46e611376d854632e03ecf0262ca
2016-05-22 02:19:09 -07:00
Johannes Plunien fcec744e76 Fix example code in readme
Summary: Closes https://github.com/facebook/FBSimulatorControl/pull/266

Differential Revision: D3333324

Pulled By: marekcirkos

fbshipit-source-id: f1e451c539dbb65667401716a4f21f4ccd523067
2016-05-22 01:49:01 -07:00
Lawrence Lomax 4a6013105a Add FBiOSTarget
Summary: This can become the common protocol that Devices & Simulators provide. The Target can then expose a set of Commands, which will allow callers of the API to use the methods for Devices & Simulators. We can add to this Protocol over time as more common behaviours for Devices & Simulators become available.

Reviewed By: marekcirkos

Differential Revision: D3322073

fbshipit-source-id: fe308861975324f4ba750abdce9330ad63697d0d
2016-05-20 07:49:14 -07:00