GithubHelp home page GithubHelp logo

facebook / idb Goto Github PK

View Code? Open in Web Editor NEW
4.4K 126.0 429.0 95.85 MB

idb is a flexible command line interface for automating iOS simulators and devices

Home Page: https://fbidb.io

License: MIT License

Objective-C 78.04% Shell 0.36% Python 12.65% C 0.09% Dockerfile 0.01% JavaScript 0.13% CSS 0.04% Swift 5.95% MDX 2.74%

idb's Introduction

idb logo

Discord

The "iOS Development Bridge" or idb, is a command line interface for automating iOS Simulators and Devices. It has three main principles:

  • Remote Automation: idb is composed of a "companion" that runs on macOS and a python client that can run anywhere. This enables scenarios such as a "Device Lab" within a Data Center or fanning out shards of test executions to a large pool of iOS Simulators.
  • Simple Primitives: idb exposes granular commands so that sophisticated workflows can be sequenced on top of them. This means you can use idb from an IDE or build an automated testing scenario that isn't feasible with default tooling. All of these primitives aim to be consistent across iOS versions and between iOS Simulators and iOS Devices. All the primitives are exposed over a cli, so that it's easy to use for both humans and automation.
  • Exposing missing functionality: Xcode has a number of features that aren't available outside its user interface. idb leverages many of Private Frameworks that are used by Xcode, so that these features can be in GUI-less automated scenarios.

idb is built on top the FBSimulatorControl and FBDeviceControl macOS Frameworks, contained within this repository. These Frameworks can be used independently of idb, however idb is likely to provide the simplest install and the most sensible defaults for most users.

We've given a talk about idb at F8, so that you can learn more about what idb is and why we built it. A recording of the talk is available here.

Quick Start

idb is made up of 2 major components, each of which needs to be installed separately.

idb companion

Each target (simulator/device) will have a companion process attached allowing idb to communicate remotely.

The idb companion can be installed via brew or built from source

brew tap facebook/fb
brew install idb-companion

Note: Instructions on how to install brew can be found here

idb client

A cli tool and python client is provided to interact with idb.

It can be installed via pip:

pip3.6 install fb-idb

Note: The idb client requires python 3.6 or greater to be installed.

Please refer to fbidb.io for detailed installation instructions and a guided tour of idb.

Once installed, just run the list-targets command which will show you all the simulators installed on your system:

$ idb list-targets
...
iPhone X | 569C0F94-5D53-40D2-AF8F-F4AA5BAA7D5E | Shutdown | simulator | iOS 12.2 | x86_64 | No Companion Connected
iPhone Xs | 2A1C6A5A-0C67-46FD-B3F5-3CB42FFB38B5 | Shutdown | simulator | iOS 12.2 | x86_64 | No Companion Connected
iPhone Xs Max | D3CF178F-EF61-4CD3-BB3B-F5ECAD246310 | Shutdown | simulator | iOS 12.2 | x86_64 | No Companion Connected
iPhone Xʀ | 74064851-4B98-473A-8110-225202BB86F6 | Shutdown | simulator | iOS 12.2 | x86_64 | No Companion Connected
...

list-apps will show you all the apps installed in a simulator:

$ idb list-apps --udid 74064851-4B98-473A-8110-225202BB86F6
com.apple.Maps | Maps | system | x86_64 | Not running | Not Debuggable
com.apple.MobileSMS | MobileSMS | system | x86_64 | Not running | Not Debuggable
com.apple.mobileslideshow | MobileSlideShow | system | x86_64 | Not running | Not Debuggable
com.apple.mobilesafari | MobileSafari | system | x86_64 | Not running | Not Debuggable

launch will launch an application:

$ idb launch com.apple.mobilesafari

Head over to the main documentation for more details on what you can do with idb and the full list of commands. There are also instructions on how to make changes to idb including building it from source.

Documentation

Find the full documentation for this project at fbidb.io

We also have a public Discord Server that you can join

Contributing

We've released idb because it's a big part of how we scale iOS automation at Facebook. We hope that others will be able to benefit from the project where they may have needs that aren't currently serviced by the standard Xcode toolchain.

Code of Conduct

Facebook has adopted a Code of Conduct that we expect project participants to adhere to. Please read the full text so that you can understand what actions will and will not be tolerated.

Contributing Guide

Read our contributing guide to learn about our development process.

License

idb is MIT-licensed.

idb's People

Contributors

adamjernst avatar ajbalik avatar alxr-fb avatar amyreese avatar asm89 avatar c-ryan747 avatar carlacosenza avatar cuva avatar dado3212 avatar dependabot[bot] avatar fejese avatar fgasperij avatar fr0l avatar hnisiji avatar ispeters avatar jamescoggan avatar jbardini avatar jkb1905 avatar k21 avatar lawrencelomax avatar marekcirkos avatar maru avatar mmmulani avatar nslingerland avatar plu avatar stepanhruda avatar thegreatwallfb avatar zertosh avatar zeyadsalloum avatar zsol avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

idb's Issues

Question: getting notified when a test run finished

I was able to run an xctest using the FBSimulatorControl library by passing in the same environment and command line arguments as XCode does when it starts the tests.
I quickly realized that I have to build some kind of waiting mechanism before I terminate the simulator (which does the cleanup), but I haven't found anything on the API which could help me achieving this.

This is what I have tried:

  • I tried to poll the session.state.runningProcesses to see whether the process is still there, but it seems that it is not removed from there.
  • I realized that the app (with the injected tests) runs in a separate os process and I can get the process ID for it. With this information I can run ps to check whether the process is still alive (I could not get repeatedlyRunCommand:withError:untilTrue: working in FBTaskExecutor because of a validation timeout, but probably this direction could work).

I wonder if there is a better way to get notified on the end of the text execution.

Connection to test manager daemon times out on iOS 8.4 simulator

Hi,

thanks for the great work on this project, I'm following the changes every day with excitement :).

I'm playing around with XCTest execution on different simulators. It works great if I execute the test suite on FBSimulatorConfiguration.iPhone5.iOS_9_3 or on FBSimulatorConfiguration.iPhone6.iOS_9_3 for example. However the connection to the test manager daemon always times out when using FBSimulatorConfiguration.iPhone5.iOS_8_4. The error message looks like this:

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason:
'Error Domain=com.facebook.FBSimulatorControl Code=0 "Failed start test manager"
UserInfo={NSLocalizedDescription=Failed start test manager, NSUnderlyingError=0x114aa6820
{Error Domain=com.facebook.XCTestBootstrap Code=0 "Failed to connect to the daemon" UserInfo=
{NSLocalizedDescription=Failed to connect to the daemon, NSUnderlyingError=0x114aa93d0
{Error Domain=com.facebook.XCTestBootstrap Code=0 "Timed out waiting for daemon connection" UserInfo=
{NSLocalizedDescription=Timed out waiting for daemon connection}}}}}'

If you need more information, please let me know!

I'm on this commit btw: 2159e73

/Edit: And on Xcode 7.3.1

Thanks,
Johannes

fatal error: unexpectedly found nil while unwrapping an Optional value

Xcode 7.2, OS X 10.11.2, fbsimctl rev 74b5d34b912c4ecc1a788b74249ea1eaf81ab917

$ ./fbsimctl list --device-name
iPhone 4s
iPhone 4s
iPhone 5
iPhone 5
iPhone 5s
iPhone 6
iPhone 6 Plus
iPhone 6s
iPhone 6s Plus
iPad 2
iPad Retina
iPad Air
iPad Air 2
fatal error: unexpectedly found nil while unwrapping an Optional value
Illegal instruction: 4
$ ./fbsimctl list
916F3B85-B553-4236-848C-03911CE65A9B iPhone 4s
06139099-8108-4382-B9B3-3CC0ADB8E48E iPhone 4s iOS 9.2
FAEA8059-5985-4F37-97A6-BEF0289E5618 iPhone 5
279402FF-F382-42FE-913B-72C174508E67 iPhone 5
9BEC0903-2A1E-4AAC-9D17-95AB6212FEBC iPhone 5s
A917A554-E007-463A-B6EE-A0C5EC9D43DC iPhone 6
E3FF4EA6-2A34-4674-9A2F-85CC492C6E08 iPhone 6 Plus
49C38D7C-D6A3-4AB5-B583-63E9C1F7D049 iPhone 6s
6CAB4429-95AC-4D73-9104-D90E9A39CD5F iPhone 6s Plus
7EEB6ADD-270F-406B-A42A-2B7D4A18F2BE iPad 2
CD50286D-8359-4B04-8CCA-E722A88A87BE iPad Retina
C12AE0ED-8A8D-47AE-8C07-FB339E44E7F4 iPad Air
02495F7E-FE39-434F-9179-93A3D0E68A8E iPad Air 2
E69A1E8F-C166-4825-A720-CDB7D7A9FD3A iPad Pro
B1EC2270-92AA-4415-A3A3-8690A8015C96 Apple TV 1080p
588BE5C6-CAB9-4709-A7E9-C2B0DA298217 Apple Watch - 38mm
D6FF1DE9-1101-43DA-BE22-8804C11398C6 Apple Watch - 42mm

Invoking test with XCTestBootstrap on real device

Moved issue from facebookarchive/WebDriverAgent#114 (comment)

@marekcirkos
After investigate the fbsimctl sources and flows. I'm starting to port fbsimctl to fbdevicectl. However I'm stuck at FBXCTestPreparationStrategy

(instancetype)strategyWithApplicationPath:(NSString *)applicationPath applicationDataPath:(NSString *)applicationDataPath testBundlePath:(NSString *)testBundlePath;
Could I confirm sth?

applicationPath: is path to *.app which is generated by Xcode after build test
applicationDataPath: is path to .xcappdata which is download by Xcode -> Window -> Devices -> DownloadContainer
testBundlePath: is path to *.xctest that is subfolder in *.app
Otherwise, in testBundlePath for real device doesn't have .xctestconfiguration

Here is structure of *.app

WebDriverAgentRunner-Runner.app
- _CodeSignature
- embedded.mobileprovision
- Frameworks
- Info.plish
- PkgInfo
- Plugins
- WebDriverAgentRunner.xctest
- _CodeSignature
- Frameworks
- Info.plist
- WebDriverAgentRunner
- XCTRunner

Build fbsimctl

fbsimctl is a WIP subproject in the repo, using the FBSimulatorControl.framework from a separate workspace. It is a Swift-based mac CLI that aims to expose a bunch of the features in a way that doesn't require directly require interfacing with the framework. In is intended to be extended in the future and to do many of the things that simctl doesn't.

  • Create Umbrella header for FBSimulatorControl so it can be used externally in Swift
  • Add a new Target and CLI app called fbsimctl that uses FBSimulatorControl
  • Parser Combinators for the CLI commands
  • Query: Text representation of a Predicate for fetching simulators
  • Format: A Text representation of Simulators by querying for properties
  • list: Lists all Simulators by a query and a format
  • boot: Boots Simulators by a query
  • shutdown: Shuts down Simulators by a query
  • upload: Uploads photos and videos to a bunch of queried Simulators.
  • diagnose: Shows diagnostic information in a variety of formats.
  • launch: Launches applications and agents
  • install: Installs applications
  • interact: An interactive mode for fbsimctl
  • stdout/stderr based interactive mode
  • TCP Socket-Server based interactive mode
  • Hangup & SIGTERM tearing down simulators
  • help: prints out help for a subcommand
  • Update the README

FBSimulatorControl Remote Client

Whilst moving in the direction of providing a cli for interacting with FBSimulatorControl there's the need for a machine readable data interchange format so that clients of fbsimctl can read output without any parsing.

The more datatypes that are serializable, the closer we can get to producing an FBSimulatorControl instance that can talk to a remote server instead of a local CoreSimulator. It's best to do this at the FBSimulatorControl level than the fbsimctl level as this will mean that a remote FBSimulatorControl server can be made for both the Framework and cli use-case.

Should FBDeviceControl work out of the box?

Hi guys,

After hacking for several days, I finally have FBDeviceControl launching an XCUITest bundle on the device. I actually just added a unit test into the project (with some hard coded values like device_id, applicationPath etc.) and invoked all the methods one would invoke for launching a test bundle.

I encountered 3 problems:

  1. [DTXMessage alloc] returns nil. It seems the class is not fully loaded at runtime. Had to replace with [NSClassFromString(@"DTXMessage") alloc].
  2. Path to XCTest.framework and IDEBundleInjection.framework are not provided or dynamically determined, and so when the data package is copied over to the device, those frameworks are not included (and thus the test runner app will crash due to not being able to find them).
  3. No CodeSignProvider is ever provided to the bundles that are copied to the device. Therefore, even if I supply a valid path to the private frameworks to copy to the device, the executables can not be run as they are not signed appropriately. This issue in particular seems problematic because if the library is exposed through a CLI interface, it will require the user to somehow indicate signing identity (generally, I try to abstract these types of details away from end users, since anything code-signing related is fairly arcane to most people).

I had assumed that this project was already working internally for you guys, but given these three obstacles I have to conclude that either some special setup is required (if so, it would be great to detail in the README), or that the open source project isn't intended to be fully functional out of the box?

How to run UITests once WDA is launched

I was able to successfully start WDA using : fbsimctl --state=booted \launch_xctest /Users/anray/Library/Developer/Xcode/DerivedData/WebDriverAgent-coxwrbfiscbrpzexnaqixqobjpxo/Build/Products/Debug-iphonesimulator/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest com.test.booking.debug --port 8100 --\listen
Few queries related to running UITests using fbsimtcl:

-> Before starting the WDA, do I need to boot required simulators , I believe yes, Thoughts ?
-> Once WDA is started , how should I run my UITests using XCTool command line code now, and on multiple simulators, usecase is , I have 4-5 tests and I want each one of them to run on different booted simulators.

Add Tests for the n-1 iOS Simulator Version

The Xcode 7 toolchain can run iOS 9 and iOS 8.4 Simulators.
The Xcode 6 toolchain can run iOS 8 and iOS 7.1 Simulators.

This allows a spread of the 3 most recent iOS versions, provided they are run in the correct way. We could probably use some automated way of testing this (assuming that the iOS Device Support exists).

How to install an app with fbsimctl?

I have already booted a simulator. Now to try to install my app with the command as follows:
fbsimctl install "7FBA26B0-222A-4F51-82AB-BBD6E5B324BC" --application "test.ipa"

but it does not work. Could you tell me what is wrong with this command?

[Documentation Reqest] Provide example test target that doesn't depend on an Application target

The README states that it should be possible to create test targets that don't depend on Application targets.

Test targets can be made that don't depend on any Application targets, or that launch multiple Application targets.

I'd love to make use of this, but there don't seem to be any examples demonstrating how to do this.

So I'm creating this issue to track providing an example configuration in FBSimulatorControl documentation. Alternatively, this could be provided as an integration test.

Thanks!

Link is missing

`The tests should provide you with some basic guidance for getting started. Run them to see multiple-simulator launching in action``

Seems like the link to https://github.com/facebook/FBSimulatorControl/blob/master/FBSimulatorControlTests/FBSimulatorControlEndToEndTests.m is broken.

Diagnostic interaction for Instruments.app

Instruments has a CLI, that allows attaching to an already running process.

It would be great if we could leverage this to automate profiling the app, then view the data after the interaction.

fbsimctl boots all simulators

I'd expect boot to create one simulator that exactly matches the given name, not all of them. If I use the UUID then it works.

$ ./fbsimctl list
06139099-8108-4382-B9B3-3CC0ADB8E48E iPhone 4s iOS 9.2
...
$ ./fbsimctl boot "iPhone 4s iOS 9.2"
Booting 916F3B85-B553-4236-848C-03911CE65A9B iPhone 4s
Error Domain=com.facebook.FBSimulatorControl Code=0 "Expected Simulator 916F3B85-B553-4236-848C-03911CE65A9B to be Booted, but it was 'Booted'" UserInfo={launchd_is_running=0, launchd_subprocesses=[(null)], NSLocalizedDescription=Expected Simulator 916F3B85-B553-4236-848C-03911CE65A9B to be Booted, but it was 'Booted'}
medwards-l:build medwards$ ./fbsimctl boot "iPhone 4s iOS 9.2"
Booting 916F3B85-B553-4236-848C-03911CE65A9B iPhone 4s
Error Domain=com.facebook.FBSimulatorControl Code=0 "Expected Simulator 916F3B85-B553-4236-848C-03911CE65A9B to be Booted, but it was 'Booted'" UserInfo={launchd_is_running=0, launchd_subprocesses=[(null)], NSLocalizedDescription=Expected Simulator 916F3B85-B553-4236-848C-03911CE65A9B to be Booted, but it was 'Booted'}
medwards-l:build medwards$ ./fbsimctl boot "iPhone 4s iOS 9.2"
Booting 916F3B85-B553-4236-848C-03911CE65A9B iPhone 4s
Jan  6 00:07:46  FBSimulatorControl[18468] <Info>: 916F3B85-B553-4236-848C-03911CE65A9B: Did Change State => Booting
Jan  6 00:07:46  FBSimulatorControl[18468] <Info>: 916F3B85-B553-4236-848C-03911CE65A9B: Did Start => simulator_pid 18472 | launchd_sim_pid 18475
Jan  6 00:07:46  FBSimulatorControl[18468] <Info>: 916F3B85-B553-4236-848C-03911CE65A9B: Did Change State => Booted
Booted 916F3B85-B553-4236-848C-03911CE65A9B iPhone 4s
Booting 06139099-8108-4382-B9B3-3CC0ADB8E48E iPhone 4s iOS 9.2
Jan  6 00:07:46  FBSimulatorControl[18468] <Info>: 06139099-8108-4382-B9B3-3CC0ADB8E48E: Did Change State => Booting
Jan  6 00:07:46  FBSimulatorControl[18468] <Info>: 06139099-8108-4382-B9B3-3CC0ADB8E48E: Did Start => simulator_pid 18504 | launchd_sim_pid 18517
Jan  6 00:07:47  FBSimulatorControl[18468] <Info>: 06139099-8108-4382-B9B3-3CC0ADB8E48E: Did Change State => Booted
Booted 06139099-8108-4382-B9B3-3CC0ADB8E48E iPhone 4s iOS 9.2
Booting FAEA8059-5985-4F37-97A6-BEF0289E5618 iPhone 5
Jan  6 00:07:47  FBSimulatorControl[18468] <Info>: FAEA8059-5985-4F37-97A6-BEF0289E5618: Did Change State => Booting
Jan  6 00:07:48  FBSimulatorControl[18468] <Info>: FAEA8059-5985-4F37-97A6-BEF0289E5618: Did Start => simulator_pid 18547 | launchd_sim_pid 18557
Jan  6 00:07:48  FBSimulatorControl[18468] <Info>: FAEA8059-5985-4F37-97A6-BEF0289E5618: Did Change State => Booted
Booted FAEA8059-5985-4F37-97A6-BEF0289E5618 iPhone 5
Booting 279402FF-F382-42FE-913B-72C174508E67 iPhone 5
Jan  6 00:07:49  FBSimulatorControl[18468] <Info>: 279402FF-F382-42FE-913B-72C174508E67: Did Change State => Booting
Jan  6 00:07:50  FBSimulatorControl[18468] <Info>: 279402FF-F382-42FE-913B-72C174508E67: Did Start => simulator_pid 18603 | launchd_sim_pid 18617
Jan  6 00:07:50  FBSimulatorControl[18468] <Info>: 279402FF-F382-42FE-913B-72C174508E67: Did Change State => Booted
Booted 279402FF-F382-42FE-913B-72C174508E67 iPhone 5
Booting 9BEC0903-2A1E-4AAC-9D17-95AB6212FEBC iPhone 5s
Jan  6 00:07:53  FBSimulatorControl[18468] <Info>: 9BEC0903-2A1E-4AAC-9D17-95AB6212FEBC: Did Change State => Booting
Jan  6 00:07:53  FBSimulatorControl[18468] <Info>: 9BEC0903-2A1E-4AAC-9D17-95AB6212FEBC: Did Start => simulator_pid 18679 | launchd_sim_pid 18692
Jan  6 00:07:53  FBSimulatorControl[18468] <Info>: 9BEC0903-2A1E-4AAC-9D17-95AB6212FEBC: Did Change State => Booted
Booted 9BEC0903-2A1E-4AAC-9D17-95AB6212FEBC iPhone 5s
Booting A917A554-E007-463A-B6EE-A0C5EC9D43DC iPhone 6
Jan  6 00:07:57  FBSimulatorControl[18468] <Info>: A917A554-E007-463A-B6EE-A0C5EC9D43DC: Did Change State => Booting
Jan  6 00:07:57  FBSimulatorControl[18468] <Info>: A917A554-E007-463A-B6EE-A0C5EC9D43DC: Did Start => simulator_pid 18757 | launchd_sim_pid 18761
Jan  6 00:07:57  FBSimulatorControl[18468] <Info>: A917A554-E007-463A-B6EE-A0C5EC9D43DC: Did Change State => Booted
Booted A917A554-E007-463A-B6EE-A0C5EC9D43DC iPhone 6
Booting E3FF4EA6-2A34-4674-9A2F-85CC492C6E08 iPhone 6 Plus
...

Include common templates for injecting diagnostic dylibs

Apps like Reveal allows additional data gathering by loading a dylib in the Application process at launch. DYLD_INSERT_LIBRARIES can be used to automate this from FBSimulatorControl. There could be some helper methods that do the right thing by looking in the right place.

There's also dylibs that Apple uses for Xcode debugging features like the View Hierarchy Debugger, ASAN & the backtrace-across-dispatches. These can be seen by printing the environment when launching Simulators from Xcode.

Unable to createSessionForSimulatorConfiguration.

While creating the the session getting error the following error:

Error Domain=com.facebook.FBSimulatorControl Code=0 "Failed to allocate simulator" UserInfo=0x618000077b80 {NSLocalizedDescription=Failed to allocate simulator, NSUnderlyingError=0x618000052810 "Failed to create a simulator with the name iPhone 5s"}

Help output is too useful

$ ./build/Build/Products/Debug/fbsimctl help
Help

I know this is mentioned in #70 but maybe it'd be better to say:

"Help information coming soon..."

Make a Podspec

It would be cool if we could make a Podspec for FBSimulatorControl, simplifying the instructions for installation/linking.

Retrying on FBSimulatorInteraction

id<FBSimulatorInteraction> can be called multiple times, some actions are flaky on certain OS versions (launching apps on XC7 GM). The API is chain able already so shouldn't be that big of an issue.

Improve FBSimulator Inflation

Currently, FBSimulator instances are inflated on demand and then discarded (if they aren't referenced). It should be pretty easy to figure out the processIdentifier of running Simulators as well rather than having it set to -1. Using the Notifiers can help keep the instances up-to-date.

Arguments to pass to fbsimctl

Is there any documents around what parameters to pass to fbsimctl to launch simulator with udid or something similar to unit tests you guys have for FBSimulatorControl?

Add ability to take a screenshot

Is it possible to take a screenshot of the simulated app? I see that DVDDevice.h has a method called:

- (void)takeScreenshotWithCompletionBlock:(CDUnknownBlockType)arg1;

It's not clear to me how I could access this object from FBSimulatorSessionInteraction.

Get travis-ci working

Now that Travis has been enabled for this repo, we should fix the .travis.yml and get builds and tests running.

FBFramebufferVideo: getSubtractiveDecodeDuration signalled err=-12633

When I launch a simulator with the following options:
FBSimulatorLaunchOptions launchOptions = FBSimulatorLaunchOptionsEnableDirectLaunch | FBSimulatorLaunchOptionsRecordVideo | FBSimulatorLaunchOptionsShowDebugWindow;

It happens often that I get an error like the following:

[10:39:54.125] getSubtractiveDecodeDuration signalled err=-12633 (kFigFormatWriterError_InvalidTimestamp) (decode timestamp is less than previous sample's decode timestamp) at /SourceCache/CoreMedia/CoreMedia-1562.240/Prototypes/FormatHandlers/FigFormatWriter_QTMovie.c line 9867
[10:39:54.129] FigMediaProcessorGetSampleBufferProcessor signalled err=-12785 (kFigBaseObjectError_Invalidated) (FigMediaProcessor was invalidated) at /SourceCache/CoreMedia/CoreMedia-1562.240/Prototypes/MediaConverter/FigMediaProcessor.c line 787
[10:39:54.129] VTCompressionSessionGetPixelBufferPool signalled err=-12903 (kVTInvalidSessionErr) (Session was invalidated) at /SourceCache/CoreMedia_frameworks/CoreMedia-1562.240/Sources/VideoToolbox/VTCompressionSession.c line 2250
2016-02-15 10:39:54.130 swoctopus[54300:4456275] 1 Time 25.790000 | Count 901 Time 25.772000 | Count 900 1
[10:39:54.131] assetWriter_AddPixelBuffer signalled err=-12633 (storage->failureError) (AssetWriter has posted a failure notification) at /SourceCache/CoreMedia/CoreMedia-1562.240/Prototypes/MediaConverter/FigRemaker.c line 14257

Which makes the video file unusable. I've tried to set static const CMTimeScale FBFramebufferTimescale = 1000; to a lower value. This seems helps avoid the error, but also makes the code drop a significant amount of frames.

Any idea how this could be prevented?

Simulator's connection is `nil` unless explicitly launched

If you have a simulator that is already running and you want to run a test, the test will fail with a "can not connect" message (see below) because the FBSimulator will not initialize the connection unless you explicitly boot it within the same process:

NSUnderlyingError=0x7fd1621d41f0 {Error Domain=com.facebook.FBSimulatorControl Code=0 "Could not connect bridge to Simulator in order to launch application App Launch <app name>

The 'problematic' code is in FBSimulatorBootStrategy.m:

- (BOOL)boot:(NSError **)error
{
  // Return early depending on Simulator state.
  if (self.simulator.state == FBSimulatorStateBooted) {
    return YES;
  }

  //...
  //<snip>
  //...

  [self.simulator.eventSink connectionDidConnect:connection];

  return YES;
}

This might not be your intended use case for running tests, but if someone is using fbsimctl as a standalone binary, launches a sim and then tries to run a test, I think they will experience this same problem.

Configuring ASL logging

Is it possible to configure the ASL logging?

I would like to turn it off completely if possible.

I will admit that I haven't done a deep investigation of this - I thought it would be worth asking in case there was an obvious answer.

Thanks for your efforts!

Can not upload app data bundle on 32 bit arch devices

So far, iPod Touch 5th Gen (Apple A5 32 bit chip) and iPhone 5 (Apple A6 32 bit chip) fail on data bundle upload (as part of starting an xctest). iPhone 6 (64 bit) works fine.

I'm not sure if this is resolvable, as even Xcode has trouble with the container data for those devices (both displaying and downloading), was wondering if you guys had some insight into workarounds?

Allocate simulator by UUID

Suppose we would like a reference to a simulator with a specific UUID (e.g., because we know we have put that exact instance in a particular state we want).

I can do this by creating a very generic FBSimulatorSet

FBSimulatorControlConfiguration *controlConfig = [FBSimulatorControlConfiguration configurationWithDeviceSetPath:nil
                                                                                                             options:0];
FBSimulatorSet *sims = [FBSimulatorSet setWithConfiguration:controlConfig
                                                    control:self.control
                                                     logger:nil
                                                      error:&e];

And then running a query on the result:

FBiOSTargetQuery *query = [FBiOSTargetQuery udids:@[deviceID]];
NSArray <FBSimulator *> *results = [sims query:query];

However, when I try to use one of the resulting simulators I get odd memory behavior, such as the simulator's set being nil or the processFetcher being nil. When I use lldb, sometimes these values are present.

The behavior is consistent when I obtain a simulator using the recommended approach (allocating a particular FBSimulatorConfiguration), but the configurations don't seem to allow for specifying a particular UUID.

Unable to run a non-system app

I made a simple program to launch an app in a simulator, but it's not working :/ I started with the code example, in the Readme for launching safari, and that worked great.

Then I replaced the configurationWithApplication argument to be

[FBSimulatorApplication
  applicationWithPath: @"/Path/to/My.app"
  error:&error]

Instead of the previous [FBSimulatorApplication systemApplicationNamed:@"MobileSafari"]

Inspecting the resulting, it seemed to have loaded the bundleId, binary path, etc. correctly, and it started the simulator, but it failed to install & launch my app.
Here's the error:

Domain=com.facebook.FBSimulatorControl Code=0 "Failed to launch application" UserInfo=0x10144bd00 {NSLocalizedDescription=Failed to launch application, launchd_is_running=true, launchd_subprocesses=(
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/sbin/syslogd | PID 34083",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/libexec/UserEventAgent (System) | PID 34084",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/FileProvider.framework/Support/fileproviderd | PID 34085",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/libexec/routined | PID 34086",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/MediaStream.framework/Support/mstreamd | PID 34087",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/MediaRemote.framework/Support/mediaremoted | PID 34088",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/IDSSimulatorSupport.framework/Support/ids_simd | PID 34089",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/libexec/installd | PID 34091",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/IDS.framework/identityservicesd.app/identityservicesd | PID 34092",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/TouchRemote.framework/Support/touchsetupd | PID 34093",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/CoreServices/AppleIDAuthAgent | PID 34094",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/WatchKit.framework/Support/companionappd | PID 34095",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/AssetsLibrary.framework/Support/assetsd | PID 34096",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/libexec/wcd | PID 34097",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/CoreServices/SpringBoard.app/SpringBoard | PID 34098",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/libexec/backboardd | PID 34099",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/libexec/locationd | PID 34101",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/libexec/assertiond | PID 34102",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/GenerationalStorage.framework/revisiond | PID 34103",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/CoreSimulator/RuntimeOverlay/usr/libexec/SimulatorBridge | PID 34104",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/libexec/configd_sim -d | PID 34105",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/CoreSimulator/RuntimeOverlay/usr/libexec/CoreSimulatorBridge | PID 34106",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/sbin/notifyd | PID 34107",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/sbin/cfprefsd daemon | PID 34108",
    "Process aslmanager | PID 34109",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/libexec/MobileGestaltHelper | PID 34110",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/libexec/nsurlsessiond | PID 34111",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/libexec/securityd | PID 34112",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/sbin/distnoted daemon | PID 34113",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/TelephonyUtilities.framework/callservicesd | PID 34114",
    "Process /usr/libexec/pkd -d/tmp/PlugInKit-Annotations | PID 34116",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/TCC.framework/tccd | PID 34118",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/ApplePushService.framework/apsd | PID 34119",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/libexec/networkd | PID 34120",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/MobileContainerManager.framework/Support/containermanagerd | PID 34122",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/libexec/mobileassetd | PID 34123",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/CarKit.framework/Support/carkitd | PID 34124",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/ManagedConfiguration.framework/Support/profiled | PID 34125",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/UserActivity.framework/Agents/useractivityd | PID 34126",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/Applications/MobileSafari.app/webbookmarksd | PID 34127",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/Accounts.framework/accountsd | PID 34128",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/AssetCacheServices.framework/XPCServices/AssetCacheLocatorService.xpc/AssetCacheLocatorService -d | PID 34129",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/iTunesStore.framework/Support/itunesstored | PID 34130",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/Applications/ServerDocuments.app/PlugIns/ServerFileProvider.appex/ServerFileProvider | PID 34131",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/libexec/nsurlstoraged | PID 34132",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/libexec/nanoregistryd | PID 34136",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/libexec/lsd runAsRoot | PID 34137",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/CalendarDaemon.framework/Support/calaccessd | PID 34138",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/IMDPersistence.framework/XPCServices/IMDPersistenceAgent.xpc/IMDPersistenceAgent | PID 34139",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/sbin/filecoordinationd | PID 34141",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/StreamingZip.framework/XPCServices/com.apple.StreamingUnzipService.xpc/com.apple.StreamingUnzipService | PID 34145",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/libexec/nanoregistrylaunchd | PID 34146",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/libexec/sharingd | PID 34150",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/GeoServices.framework/geod | PID 34151",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/Search.framework/searchd | PID 34152",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/Applications/MobileCal.app/PlugIns/MobileCalSpotlight.appex/MobileCalSpotlight | PID 34153",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/Applications/Reminders.app/PlugIns/RemindersSpotlight.appex/RemindersSpotlight | PID 34154",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/Applications/Contacts.app/PlugIns/ContactsCoreSpotlightExtension.appex/ContactsCoreSpotlightExtension | PID 34155",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/FoundationODR.framework/ondemandd.bundle/ondemandd | PID 34159",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/AuthKit.framework/akd | PID 34160",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/Accessibility.framework/Frameworks/AccessibilityUI.framework/XPCServices/com.apple.accessibility.AccessibilityUIServer.xpc/com.apple.accessibility.AccessibilityUIServer | PID 34161",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/PassKit.framework/passd | PID 34162",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/MusicLibrary.framework/Support/medialibraryd | PID 34163",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/AudioToolbox.framework/XPCServices/com.apple.audio.SystemSoundServer-iOS-Simulator.xpc/com.apple.audio.SystemSoundServer-iOS-Simulator | PID 34164",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/AppSupport.framework/Support/cplogd | PID 34165",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/Applications/MobileCal.app/MobileCal | PID 34166",
    "Process /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/CoreServices/CFNetworkAgent | PID 34168"
), NSUnderlyingError=0x101130010 "The operation couldn’t be completed. (FBSOpenApplicationErrorDomain error 4.)"}

fbsimctl direct launch mode -- keeping process up

Hello,

Got a question about direct launch mode. Usage documentation for fbsimctl states:

However, fbsimctl will connect a Framebuffer to the Simulator as it is Booting. This enables Video Recording, providing that the fbsimctl process is kept alive.

What is the recommended way to keep fbsimctl process up? At the moment I'm trying to use listen for that purpose and launching it as a subprocess or in another thread. But the problem is that it says:

{"event_type":"discrete","subject":"Error Domain=com.facebook.FBSimulatorControl Code=0 \"Simulator Does not have a FBFramebufferVideo instance\" UserInfo={NSLocalizedDescription=Simulator Does not have a FBFramebufferVideo instance}","timestamp":1469720386,"event_name":"failure"}

for record start. Seems like it can't allocate Framebuffer on another thread/process.

There's also another question -- can multiple fbsimctl instances run at the same time (in case I'm trying to keep direct-launch mode up)? I'm having issues running 8+ simulators in parallel, it throws posix_spawn error 35, seems to be connected with some shared resources, but I'm not sure if its on the side of fbsimctl or CoreSimulator.

Thanks for great library and utilities, I'm trying to use it in parallel UI-tests automation scripts. Most valuable features for me are:

  • direct-launch (seems to reduce resources requirements per simulator);
  • video recording (it's way easier to find problems if test fails);
  • watchdog override (on simulator.app my app gets killed sometimes during heavy loads);

Interface to Darwin Notifications

There's a few interesting ones that do tasks that SimulatorBridge doesnt:

  • com.apple.UIKit.SimulatorShake
  • com.apple.BiometricKit_Sim.fingerTouch.match
  • com.apple.BiometricKit_Sim.fingerTouch.nomatch
  • com.apple.BiometricKit.enrollmentChanged
  • com.apple.iphonesimulator.toggleincallstatusbar
  • com.apple.UIKit.SimulatorSlowMotionAnimationState
  • com.apple.UIKit.ForceGraphicsQuality
  • com.apple.UIKit.SimulatorSlowMotionStateful

iOS 10 Support

Hi guys,

Is iOS10 (beta 1) supposed to work already for launching XCUITest bundles? When I attempt to run a test via the FBDeviceControl methods, it seems to upload an xctestconfiguration correctly, but when my runner launches it keeps choosing an old configuration file so the session identifiers don't match.

Specifically, I can create the configuration and device operator without issue, but when I get here:

[testRunStrategy startTestManagerWithAttributes:@[] environment:@{} error:&innerError];

It hangs on this:

2016-06-27 14:02:51.943 xctest[38756:727415] SessionID: <__NSConcreteUUID 0x114c243e0> <Some ID>

And eventually fails with

2016-06-27 14:03:30.125 xctest[38756:727415] Err: Error Domain=com.facebook.XCTestBootstrap Code=0 "Failed connect to test runner or test manager daemon" UserInfo={NSLocalizedDescription=Failed connect to test runner or test manager daemon}

In the device logs, I see the session identifier doesn't match.

I pulled the latest master this morning.

Example project needed

I may be stupid (although i'd wager I'm not) and no matter what I do I can't get this to link properly unless I embed the framework and I can't do that without a code signing issue.

Love the potential and want to use this. Better install instructions or a pod spec would be alright too.

Thanks.

applicationBundleWithBundleID always returns nil on device

[FBDeviceOperator applicationBundleWithBundleID:error] always returns nil because FBProductBundle is looking for the product bundle on the host machine (but obviously for a physical device, it won't be there):

//FBDeviceOperator.m
- (FBProductBundle *)applicationBundleWithBundleID:(NSString *)bundleID error:(NSError **)error
{
  id<DVTApplication> application = [self installedApplicationWithBundleIdentifier:bundleID];
  if (!application) {
    return nil;
  }

/*
    For a valid 'bundleID' we'll get an 'application' object back successfully
*/

  FBProductBundle *productBundle =
  [[[[[FBProductBundleBuilder builder]
      withBundlePath:[application installedPath]]
     withBundleID:[application identifier]]
    withBinaryName:[application executableName]]
   buildWithError:error];

    /*
    'productBundle' will always be nil
    */

  return productBundle;
}
//FBProductBundle.m -(FBProductBundle *)buildWithError:

<snip>
NSDictionary *infoPlist = [self.fileManager dictionaryWithPath:[self.bundlePath stringByAppendingPathComponent:@"Info.plist"]];

/*
For a device, we get a path like '/private/var/containers/Bundle/Application/89A19E0C-CAFE-FEED-FACE-80E9A6284584/MyApp.app/Info.plist'. 
self.fileManager won't find this file. since it's on the device, not the host.  
*/
  if (!infoPlist) {
    infoPlist = [self.fileManager dictionaryWithPath:[self.bundlePath stringByAppendingPathComponent:@"Contents/Info.plist"]];
  }
  if (!infoPlist) {
    return
    [[XCTestBootstrapError describeFormat:@"Failed to read Info.plist for bundle: %@", self.bundlePath]
     fail:error];
  }
</snip>

fbsimctl: Support waitUntilAllTestRunnersHaveFinishedTestingWithTimeout

It would be great to support executing tests on the command line and wait for them to finish. Example:

fbsimctl --simulators $UDID launch_xctest $APP/PlugIns/UnitTests.xctest com.ebaykleinanzeigen.ebc --wait-with-timeout 600

Another thing that would be nice is getting the test output in some sort of machine readable format (JSON?). So we can transform that in whatever we like (e.g. JUnit).

fbsimctl: Help output is not useful

$ ./build/Build/Products/Debug/fbsimctl help_pls
Failed to Parse Command '["help_pls"]' does not match '[At least 0 of Any of [--debug-logging, --json, ---pretty] followed by help, At least 0 of Any of [--debug-logging, --json, ---pretty] followed by --set followed by A Directory followed by At least 0 of Any of [--delete-all, --kill-all, --kill-spurious, --ignore-spurious-kill-fail, --kill-spurious-services, --timeout-resiliance] followed by Any of [all, At least 1 of Any of [Any of [--state=creating, --state=shutdown, --state=booting, --state=booted, --state=shutting-down], A NSUUID, A Device Name followed by An OS Version followed by --aux followed by A Directory]] followed by At least 1 of Any of [--udid, --name, --device-name, --os, --state, --pid] followed by At least 1 of Any of [approve followed by At least 1 of Any of [An Application, A Bundle ID], boot followed by --locale followed by A Locale followed by Any of [--scale=25, --scale=50, --scale=75, --scale=100] followed by At least 1 of Any of [--connect-bridge, --direct-launch, --use-nsworkspace, --debug-window], create followed by A Device Name followed by An OS Version followed by --aux followed by A Directory, delete, diagnose followed by Any of [--current-format, --path, --content] followed by Any of [Any of [An Application, A Bundle ID] followed by At least 1 of Anything, At least 1 of --name followed by Anything, --crashes-since followed by Of Double followed by At least 0 of Any of [--application, --system, --custom-agent]], install followed by An Application, launch followed by Any of [A Binary followed by Many of Anything, Any of [An Application, A Bundle ID] followed by Many of Anything], listen followed by Any of [--socket followed by Of Int, --http followed by Of Int], list, open followed by A NSURL, record followed by Any of [start, stop], relaunch followed by Any of [An Application, A Bundle ID] followed by Many of Anything, shutdown, tap followed by Of Double followed by Of Double, terminate followed by Any of [An Application, A Bundle ID], upload followed by At least 1 of A File]]'
Help

Booted sims can not be resized

We have four options for launch configurations:

  • FBSimulatorLaunchOptionsConnectBridge
  • FBSimulatorLaunchOptionsEnableDirectLaunch
  • FBSimulatorLaunchOptionsShowDebugWindow
  • FBSimulatorLaunchOptionsUseNSWorkspace

Of these, FBSimulatorLaunchOptionsConnectBridge, FBSimulatorLaunchOptionsShowDebugWindow, and FBSimulatorLaunchOptionsUseNSWorkspace launch the simulator in a state such that it can not be resized.

I don't know if FBSimulatorLaunchOptionsEnableDirectLaunch works, as I have never been able to get a sim to launch successfully with this option - it appears to be a no-op.

Maybe I'm looking in the wrong place?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.