Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
ioslib.device.detect(function (err, deviceResults) {
if (!deviceResults.devices.length) {
// no devices connected
return done(new Error('No iOS devices connected'));
}
ioslib.certs.detect(function (err, certResults) {
var certs = [];
Object.keys(certResults.certs.keychains).forEach(function (keychain) {
var types = certResults.certs.keychains[keychain];
Object.keys(types).forEach(function (type) {
certs = certs.concat(types[type]);
});
});
if (!certs.length) {
return cb(new Error('No iOS certificates'));
}
// find us a provisioning profile
ioslib.provisioning.find({
appId: self.tiapp.id,
certs: certs,