Fix cert exchange on iOS with multiple devices connected
Reviewed By: lblasa, nikoant Differential Revision: D34142119 fbshipit-source-id: e5edc4962e75f2e6f91d9ed304ffd080fd29ff27
This commit is contained in:
committed by
Facebook GitHub Bot
parent
b3cf7e1ad1
commit
c33a5f9bef
@@ -17,6 +17,8 @@ import path from 'path';
|
||||
|
||||
const tmpDir = promisify(tmp.dir) as (options?: DirOptions) => Promise<string>;
|
||||
|
||||
const logTag = 'iOSCertificateProvider';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
export default class iOSCertificateProvider extends CertificateProvider {
|
||||
name = 'iOSCertificateProvider';
|
||||
@@ -43,6 +45,7 @@ export default class iOSCertificateProvider extends CertificateProvider {
|
||||
throw new Error('No iOS devices found');
|
||||
}
|
||||
const deviceMatchList = targets.map(async (target) => {
|
||||
try {
|
||||
const isMatch = await this.iOSDeviceHasMatchingCSR(
|
||||
appDirectory,
|
||||
target.udid,
|
||||
@@ -50,6 +53,14 @@ export default class iOSCertificateProvider extends CertificateProvider {
|
||||
csr,
|
||||
);
|
||||
return {id: target.udid, isMatch};
|
||||
} catch (e) {
|
||||
console.info(
|
||||
`Unable to check for matching CSR in ${target.udid}:${appName}`,
|
||||
logTag,
|
||||
e,
|
||||
);
|
||||
return {id: target.udid, isMatch: false};
|
||||
}
|
||||
});
|
||||
const devices = await Promise.all(deviceMatchList);
|
||||
const matchingIds = devices.filter((m) => m.isMatch).map((m) => m.id);
|
||||
|
||||
Reference in New Issue
Block a user