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 tmpDir = promisify(tmp.dir) as (options?: DirOptions) => Promise<string>;
|
||||||
|
|
||||||
|
const logTag = 'iOSCertificateProvider';
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||||
export default class iOSCertificateProvider extends CertificateProvider {
|
export default class iOSCertificateProvider extends CertificateProvider {
|
||||||
name = 'iOSCertificateProvider';
|
name = 'iOSCertificateProvider';
|
||||||
@@ -43,13 +45,22 @@ export default class iOSCertificateProvider extends CertificateProvider {
|
|||||||
throw new Error('No iOS devices found');
|
throw new Error('No iOS devices found');
|
||||||
}
|
}
|
||||||
const deviceMatchList = targets.map(async (target) => {
|
const deviceMatchList = targets.map(async (target) => {
|
||||||
const isMatch = await this.iOSDeviceHasMatchingCSR(
|
try {
|
||||||
appDirectory,
|
const isMatch = await this.iOSDeviceHasMatchingCSR(
|
||||||
target.udid,
|
appDirectory,
|
||||||
appName,
|
target.udid,
|
||||||
csr,
|
appName,
|
||||||
);
|
csr,
|
||||||
return {id: target.udid, isMatch};
|
);
|
||||||
|
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 devices = await Promise.all(deviceMatchList);
|
||||||
const matchingIds = devices.filter((m) => m.isMatch).map((m) => m.id);
|
const matchingIds = devices.filter((m) => m.isMatch).map((m) => m.id);
|
||||||
|
|||||||
Reference in New Issue
Block a user