本文整理汇总了TypeScript中ios-mobileprovision-finder.provision类的典型用法代码示例。如果您正苦于以下问题:TypeScript provision类的具体用法?TypeScript provision怎么用?TypeScript provision使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了provision类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: queryProvisioningProfilesAndDevices
private async queryProvisioningProfilesAndDevices(projectId: string): Promise<{ devices: string[], match: mobileprovision.provision.Result }> {
const certificates = mobileprovision.cert.read();
const provisions = mobileprovision.provision.read();
const query: mobileprovision.provision.Query = {
Certificates: certificates.valid,
Unique: true,
AppId: projectId
};
let devices: string[] = [];
if (this.$options.device) {
devices = [this.$options.device];
} else {
await this.$devicesService.initialize({
platform: "ios",
skipEmulatorStart: true
});
devices = _(this.$devicesService.getDeviceInstances())
.filter(d => this.$mobileHelper.isiOSPlatform(d.deviceInfo.platform))
.map(d => d.deviceInfo.identifier)
.toJSON();
}
const match = mobileprovision.provision.select(provisions, query);
return { devices, match };
}
示例2: getDevelopmentTeams
public async getDevelopmentTeams(): Promise<{ id: string, name: string }[]> {
const teams: { [teamName: string]: Set<string> } = {};
// NOTE: We are reading all provisioning profiles and collect team information from them.
// It would be better if we can check the Apple ID registered in Xcode and read the teams associated with it.
mobileprovision.provision.read().forEach(provision =>
provision.TeamIdentifier && provision.TeamIdentifier.forEach(id => {
if (!teams[provision.TeamName]) {
teams[provision.TeamName] = new Set();
}
teams[provision.TeamName].add(id);
})
);
const teamsArray = Object.keys(teams).reduce((arr, name) => {
teams[name].forEach(id => arr.push({ id, name }));
return arr;
}, []);
return teamsArray;
}