Summary:
We were using an old unmaintained/abandonned library for communicating with adb server https://github.com/openstf/adbkit
This was giving me issues i couldnt figure out when running flipper server.
There is a popular fork written in typescript here https://github.com/DeviceFarmer/adbkit but it uses blue bird for promises.
There is a fork of the fork here which i have chosen to use which is the same api as above but with es6 promises, https://github.com/UrielCh/adbkit.
Both forks have a slightly different api to the original. In the original library there was a single client and any command directed at a particular device had a serial as the first argument
In the new libraries you create a DeviceClient where the serial is baked in and you don't need to supply this argument every time
allow-large-files
Reviewed By: lblasa
Differential Revision: D45569652
fbshipit-source-id: 2a23c0eaa12feaebdccadb3d343e087c0d5708d5
Summary: We can't do much if a phone is not setup properly
Reviewed By: lblasa
Differential Revision: D43980508
fbshipit-source-id: 5baf82ae36030b81c7cc90bcf6a5de2af9304fb3
Summary:
The 'screenrecord' command is not in some Android phones e.g OPPO. So 'screenrecord' command can't be used as a basis for determining whether or not you can take a screenshot. Replace it with 'screencap' command to determine whether you can take a screenshot.
## Changelog
Fixed a bug where the screenshot of some Android phones was unavailable
Pull Request resolved: https://github.com/facebook/flipper/pull/4366
Test Plan: It passed the test on my Mac and OPPO phone Reno2.
Reviewed By: ivanmisuno
Differential Revision: D42918902
Pulled By: passy
fbshipit-source-id: c1f02f075817d90e0d447f466a1168b6ec932e4e
Summary:
When we start using Flipper from the CLI for automation, we want to have the list of currently connected devices as soon as flipper server is alive.
Otherwise, we would have to poll flipper server waiting for some magical moment in the future when devices connect.
This way, we can be certain that if flipper server started, but we do not see a device, it is not connected at all.
Reviewed By: mweststrate
Differential Revision: D40184106
fbshipit-source-id: ce4c2b897a2df0081e3a0b6a8c26640599e0f9e8
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: Well, and added another word.
Reviewed By: lblasa
Differential Revision: D34944504
fbshipit-source-id: eb4e7db05ee846721fa18899aa50596124632b5b
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:
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: 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:
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
Summary:
Changelog: Fixed issue where a missing ANDROID_SDK_ROOT env var made it impossible to launch emulators
Run into an issue where ANDROID_SDK_ROOT wasn't set for my user, causing Flipper not to be able to launch emulator, which was looked up from the path rather than using the flipper settings.
Fixes: https://github.com/facebook/flipper/issues/3119
Reviewed By: timur-valiev
Differential Revision: D33158280
fbshipit-source-id: ea5616b10265ed43f1012c58da081be275ff1d5b
Summary:
This diff moves a lot of stuff from the client to the server. This diff is fairly large, as a lot of concept closely relate, although some things have split off to the earlier diffs in the stack, or are still to follow (like making intern requests).
This diff primarily moves reading and storing settings and GKs from client to server (both flipper and launcher settings). This means that settings are no longer persisted by Redux (which only exists on client). Most other changes are fallout from that. For now settings are just one big object, although we might need to separate settings that are only make sense in an Electron context. For example launcher settings.
Reviewed By: passy, aigoncharov
Differential Revision: D32498649
fbshipit-source-id: d842faf7a7f03774b621c7656e53a9127afc6192
Summary:
…s directory
Currently, flipper tries to launch emulators using `<android sdk path>\tools\emulator.exe`. The use of this emulator path has been deprecated for a while now, and remains in the sdk for those on versions of Android Studio 2.2 and older (see https://issuetracker.google.com/issues/66886035?pli=1). The supported path is `<android sdk path>\emulator\emulator.exe`. Trying to use the deprecated path on Windows results in a failure to launch AVDs.
## Changelog
Point emulator path to emulator directory instead of deprecated tools directory.
Pull Request resolved: https://github.com/facebook/flipper/pull/3046
Test Plan: Verified a failure to launch the AVD on windows using the deprecated path. Confirmed that updating the path results in a successful launch and the device showing up in flipper.
Reviewed By: passy
Differential Revision: D32489840
Pulled By: nikoant
fbshipit-source-id: dde5bf5a29e89549f160d9d71133ff70398e1c1d
Summary:
…tems
When trying to start an android emulator in Windows, there is a failure in trying to read `<avd name>.ini`. The reason for this is because when we run `<android sdk path>\tools\emulator.exe -list-avds`, a split is performed with the new line character (`\n`). Unfortunately, this does not work for Windows, which uses `\r\n` as the new line termination. This results in a carriage return remaining on each output string, which results in trying to access `<avd name> .ini`, which is an invalid path.
The fix is to update the split to use a regex that is compatible for both Unix and Windows based systems.
## Changelog
Updating splitting of avd names to work on Windows and Unix based systems
Pull Request resolved: https://github.com/facebook/flipper/pull/3041
Test Plan: Verified the avd names didn't have any trailing whitespace, and the emulator is able to launch.
Reviewed By: mweststrate
Differential Revision: D32387162
Pulled By: nikoant
fbshipit-source-id: 0900bee17b225cfa5484a29c96f8e2c1c2e31477
Summary: This change adds the alt ports to the list of ports to be reversed on Android
Reviewed By: mweststrate
Differential Revision: D31607559
fbshipit-source-id: 4e1201c7255fcd3a437c743f827ae4bceb746348
Summary: moved `app/src/server` to `flipper-server-core/src` and fixed any fallout from that (aka integration points I missed on the preparing diffs).
Reviewed By: passy
Differential Revision: D31541378
fbshipit-source-id: 8a7e0169ebefa515781f6e5e0f7b926415d4b7e9