Summary:
Starting a screencapture longer than 30 seconds would timeout as the start command waits for the process to finish. Removed that wait is it is the stop command that should only wait for the finish.
(n.b. please ship after accepting, as I'm on PTO)
Reviewed By: LukeDefeo
Differential Revision: D38918570
fbshipit-source-id: fd93e1239985c81a2143ceb79312518e7ebb27f5
Summary: There is a new flipper server command to install apps. For android it uses adb (via adb kit) For ios depending on idb availablity it will use idb or xcrun. Consumed in the next diff
Reviewed By: lblasa, aigoncharov
Differential Revision: D36936637
fbshipit-source-id: e09d34d840a9f3bf9136bcaf94fb8ca15dd27cbb
Summary: Expose uuid from flipper-common as it is required in multiple packages
Reviewed By: lblasa
Differential Revision: D36441889
fbshipit-source-id: 1fa539cb437976dbefe7d5d9a52e5e098a6402a7
Summary: Reverts D36263724 (0ee8f09fe5) and fixes the underlying crash by setting only physical devices in the permissive mode
Reviewed By: passy
Differential Revision: D36275055
fbshipit-source-id: 25a691e9c07e20a3341630db508795c133a9bd81
Summary:
Original commit changeset: 471470c5ca91
Original Phabricator Diff: D35356211 (501abc6b55)
Recently, bloks users reported that android emulators lost connection upon launching Flipper. (S270689)
Manual bisecting indicates that remote emulators won't crash on v0.142.362128844 (4/6) but crash on 0.143.365099607 (4/21).
Looking at https://www.internalfb.com/code/fbsource/[history]/xplat/scripts/.flipperversion.v2, and backing out D35356211 (501abc6b55) fixes the issue.
It's still unclear why setting `setIntoPermissiveMode` would crash/disconnect the android emulators, I'd defer Flipper team to investigate this further but this diff should unblock all the android bloks emulator + Flipper use case.
Reviewed By: lblasa
Differential Revision: D36263724
fbshipit-source-id: e8674730c0185457f6eda347ce7d9a41f9e1a2a4
Summary: Adbkit configurations settings may be neccesary when we want to run flipper-server in an IPv6 stack machine as localhost would bind to [::1] rather than 127.0.0.1 which is where the adb server usually runs
Reviewed By: mweststrate
Differential Revision: D34964851
fbshipit-source-id: 9cf70f9bdc0c40e92382b1537013439f85983f65
Summary: Well, and added another word.
Reviewed By: lblasa
Differential Revision: D34944504
fbshipit-source-id: eb4e7db05ee846721fa18899aa50596124632b5b
Summary: It's unused, can only assume that it was a log buffer in some distant time which is now hidden behind a separate log listener class
Reviewed By: passy
Differential Revision: D34787086
fbshipit-source-id: 0f920649c119efc5172ca7dcc6b53cfb802a5cbf
Summary:
Logcat can sometimes fail to clear the logs for some reason.
There's nothing we can do about this as we're directly calling out to adb.
Reviewed By: lawrencelomax
Differential Revision: D34749970
fbshipit-source-id: 2166717ace491f7b73b380576392638ef9276b78
Summary:
1. Identify if device supports screenshots/screen recording when it is created.
2. Disable screen recording/screenshot buttons when they are not supported
Reviewed By: passy
Differential Revision: D34611133
fbshipit-source-id: 82ad2d67e4af482d9becf7995187667b5d99bc36
Summary:
This error messaging is confusing for device only users. These users may only be running against a device **without xcode installed**, which is supported.
However, we also need to handle the case where a user has a sim running and they haven't xcode-select'd as this will mean that the sim is working fine, but the user has no way of knowing why Flipper is not working.
Reviewed By: passy
Differential Revision: D34140277
fbshipit-source-id: f9b035b6c7918424d6131d1dfcdba10acf438fa8
Summary: These can be batched together rather nicely
Reviewed By: lblasa
Differential Revision: D34139753
fbshipit-source-id: 7388630dcae34d40308d54f18a37215cf18e5904
Summary: Accidentally tested a function that should have been called from the internals. This makes the internal function use the check.
Reviewed By: lblasa
Differential Revision: D34139589
fbshipit-source-id: fac13f7b54ffb0b6f501fb9237f55766706e975a
Summary:
Fixes https://github.com/facebook/flipper/issues/3396 - the Xcode version mismatch check has been broken since 0.132.0.
## Changelog
Fixed Xcode version mismatch check
Pull Request resolved: https://github.com/facebook/flipper/pull/3428
Test Plan: No existing test, manually tested locally on macOS 11.6.3 via `yarn start` when launching the Simulator directly or via `yarn react-native run-ios` in an RN project
Reviewed By: lblasa, mweststrate
Differential Revision: D34139471
Pulled By: lawrencelomax
fbshipit-source-id: 97920de5c463b366ef7ecaef0441ee37debe5d46
Summary:
Certificate exchange errors should be communicated back to the user, as they are often actionable, and otherwise leave users in a stuck state.
Also removed the ServerController interface, upgraded the listener types to get at the necessary internal apis typewise that were already available.
Removed that error wrapping utility complaining about idb installation, this is rarely ever the problem anymore, and it hides the underlying error.
Reviewed By: nikoant
Differential Revision: D34105452
fbshipit-source-id: 3b3cd0b99cecbda26dfd0744a90690fe568a5ea5
Summary: Look up for the path of the adb may sometimes fail when looking for the folder platform-tools because the adb configuration wasn't done by android studio
Reviewed By: aigoncharov
Differential Revision: D33888687
fbshipit-source-id: 4d0cad2f6b19717e45422632f5d459813a7b7ee0
Summary:
When connection to Android, I always get an error popup with 'device still authorizing', which disappears itself and the device connects fine. It seems that this was a case we handled gracefully before, but the error message we check for has changed. Also updated the log message so that we get it in our monitoring I don't silently get stuck in this state.
Changelog: Fixed 'device still authorizing' errors showing up while connecting to an Android device
Reviewed By: aigoncharov
Differential Revision: D33976028
fbshipit-source-id: dbb055bbbd43bad129b10ffee4a8dbb50be8e87a
Summary: Idb and adb sholuld not really be accessed out side of Adnroid and iOS device managers
Reviewed By: lawrencelomax
Differential Revision: D33915162
fbshipit-source-id: 0d1bb028b9a53254cf5b0ce6289ae76339c5a254
Summary: Remove hidden async initialization of adb and idb. Make it explicit. Remove nullable fields in Android and iOS device managers.
Reviewed By: lawrencelomax
Differential Revision: D33915177
fbshipit-source-id: 882f79310410e0dfde6169abf343ab808644e4a2
Summary: Extract WWW certificate provider from the iOS certificate provider. Hide its implementation from OSS since it is not relevant for OSS folks.
Reviewed By: mweststrate
Differential Revision: D33895378
fbshipit-source-id: 376afda3b5fa3857c0eb280b92555314eb1a0d1f
Summary:
`idb` has supported video recording on devices for quite some time now. We even have the implementation in `iOSDevice`, but it's currently unused.
As a result, we just need to remove the check within `iOSDevice` that the target is an "emulator" and it will use the `idb` implementation. Removing this check means that the button is now selectable within the UI.
Reviewed By: passy
Differential Revision: D33913383
fbshipit-source-id: b3d6b4c480c79b54f0d2c206c68092ab62bf71ed
Summary: This should in theory never happen since the state of the recording is also managed within the UI. However, it's better to ensure that if `startRecording` is called twice, without calling `stopRecording` first it will error rather than leak a recording (the first process will still run but the object representing it is oprhaned)
Reviewed By: passy
Differential Revision: D33913298
fbshipit-source-id: f8fa6b0e4fdbdf4282633fa29a736d3e7dedf3bb
Summary:
The state of the destination and the process are coupled together. As a result it makes sense to move these to an object type.
This prevents destination and process being independently settable. No change in behaviour, just a removal of invariants that need to be checked
Reviewed By: passy
Differential Revision: D33913213
fbshipit-source-id: ed18650cac4f72d40e82d20254674f7fa12cbb48
Summary: This is public but never read, no need for it to exist
Reviewed By: passy
Differential Revision: D33893097
fbshipit-source-id: aa423464f9cc0c35768a549fd5cb481784d8bcd6
Summary:
There's no need for us to have a property that can be undefined, since we can use the magic of *passing arguments* to achieve the same end result.
The unit test a bit more precarious, but it's left here for posterity or until we decide to kill it otherwise.
Reviewed By: passy
Differential Revision: D33892407
fbshipit-source-id: 3b499511189862e2265d8d6d29f849a7b813050e
Summary:
Bulding on the work from prior diffs we can use the created bridge directly. No need to have if statements calling out to sub-functions, just use the base type itself which will use the appropriate implementation.
There's no behavioural change here. Either idb was queried for sims/devices or simctl was queried for just sims, they were always mutually exclusive.
Reviewed By: passy
Differential Revision: D33842604
fbshipit-source-id: 0bf63ffc34368c70df31c105ea0ba5df941e72cc
Summary:
We perform this *repeatedly* (every 2s!!!). Which is clearly excessive.
Let's perform this check once to avoid noise and a waste of system resources
Reviewed By: passy
Differential Revision: D33844194
fbshipit-source-id: 226dc9d67bb83b167afa8e28ade8e1911470ef8a
Summary:
This runs in a very hot loop (which I will change shortly)
However, there's also some simplification that we can do here:
- Only look for `Simulator.app` processes instead of all the processes. This limits the amount of string comparison to do. If there's a `Simulator.app` running, then we know a sim is running for that Xcode.
- Use piping to extract the launch path of the process, instead of then regex'ing this out.
- Use a simpler substring match to determine if paths have a different start.
Reviewed By: passy
Differential Revision: D33891296
fbshipit-source-id: e37d5f260fc6c6113be9c5268b7c8cffb4057b9a
Summary:
Again this is just a code move for now.
However, we now have a common method between simctl and idb cases. This means that the next diff can call an `IOSBridge` with polymorpism taking over. This is still delegated out, but there's an argument to be made to move `iosUtil` functionality back so that this all lives in the same place.
Reviewed By: passy
Differential Revision: D33843093
fbshipit-source-id: 5cd884140817df851cccf63e5780582b16d4231c
Summary:
Extracts `getSimulator` interrnals to `SimctlBridge`. This allows this functionality to be used independently of things like the the flipper server.
For now this just moves the functionality, but future diffs will build on top of this.
Reviewed By: passy
Differential Revision: D33842986
fbshipit-source-id: bae26a9bd5c21c9813f8a2b10c3b3e3efc1c5929
Summary:
This is related to `simctl` functionality, so can be extracted there.
This will aid in future changes whereby we can hide `getDeviceSetPath` in the IOSBridge module
Reviewed By: passy
Differential Revision: D33842987
fbshipit-source-id: de292ce5afba3e7d79d8ba27c2b8852909d7e6f3
Summary:
We pass the `idbPath` to only the log listener function, when in reality it should be used by all of these functions that call out to idb.
This could result in some bizzare inconsistencies where some idb functions to fail as they are not using the supplied path
Reviewed By: passy
Differential Revision: D33818298
fbshipit-source-id: f0fb7f26579c646a0d5265364d539dfded711c2e
Summary: This allows us to change the way that the command is itself exec'd (for instance to change the idb exec'ing in D33818298)
Reviewed By: passy
Differential Revision: D33818822
fbshipit-source-id: c90b7e58c7476f5db08da0e74e9791230ff97f6f
Summary: Similar to D33818267, but for simctl. Brings logical ordering of methods as well as consistency
Reviewed By: passy
Differential Revision: D33818687
fbshipit-source-id: 3fbcea128d06c900b49b83ad583ec8a7a07cae2c
Summary:
This isn't that important right now, but will help as the `IOSBridge` is expanded in the future. There's also an argument for logical ordering of functions within a container (a class!), but that's not the real motivation here.
The existence of `bind` shows that this free function is effectively closing over this argument anyway.
Reviewed By: passy, lblasa
Differential Revision: D33818267
fbshipit-source-id: e7b83f013121cedbd31cb28746b69c1fa76a0803
Summary:
Previously CertificateProvider initialized ADB and provided config to IDB. As result, AndroidDeviceManager and iOSDeviceManager indirectly depended on CertificateProvider.
With this diff we:
1. Make idbConfig resemble adbClient.
2. Make AndroidDeviceManager and iOSDeviceManager initialize their own clients
3. Fix server crash when one of the clients couldn't be initialized. The reason for the crash is CertificateProvider.prototype.init which is no longer needed.
Reviewed By: passy
Differential Revision: D33711652
fbshipit-source-id: 055b5625ed993827b65396f4af5157808479242b