@@ -52,12 +52,19 @@ export const createRun = async ({
5252 ? 'simulator'
5353 : 'device'
5454 : 'simulator' ;
55- const artifactName = await formatArtifactName ( {
56- platform : 'ios' ,
57- traits : [ deviceOrSimulator , args . configuration ?? 'Debug' ] ,
58- root : projectRoot ,
59- fingerprintOptions,
60- } ) ;
55+
56+ async function getArtifactName ( { silent } : { silent ?: boolean } = { } ) {
57+ return await formatArtifactName ( {
58+ platform : 'ios' ,
59+ traits : [ deviceOrSimulator , args . configuration ?? 'Debug' ] ,
60+ root : projectRoot ,
61+ fingerprintOptions,
62+ silent,
63+ } ) ;
64+ }
65+
66+ let artifactName = await getArtifactName ( ) ;
67+
6168 const binaryPath = await getBinaryPath ( {
6269 artifactName,
6370 binaryPathFlag : args . binaryPath ,
@@ -132,7 +139,7 @@ ${devices
132139 }
133140 cacheRecentDevice ( device , platformName ) ;
134141 if ( device . type === 'simulator' ) {
135- const [ , { appPath, infoPlistPath } ] = await Promise . all ( [
142+ const [ , { appPath, infoPlistPath, didInstallPods } ] = await Promise . all ( [
136143 launchSimulator ( device ) ,
137144 buildApp ( {
138145 args,
@@ -144,6 +151,11 @@ ${devices
144151 binaryPath,
145152 } ) ,
146153 ] ) ;
154+ // After installing pods the fingerprint likely changes.
155+ // We update the artifact name to reflect the new fingerprint and store proper entry in the local cache.
156+ if ( didInstallPods ) {
157+ artifactName = await getArtifactName ( { silent : true } ) ;
158+ }
147159 saveLocalBuildCache ( artifactName , appPath ) ;
148160 await runOnSimulator ( device , appPath , infoPlistPath ) ;
149161 } else if ( device . type === 'device' ) {
@@ -194,7 +206,7 @@ ${devices
194206 }
195207 }
196208 for ( const bootedDevice of bootedDevices ) {
197- const [ , { appPath, infoPlistPath, bundleIdentifier } ] =
209+ const [ , { appPath, infoPlistPath, bundleIdentifier, didInstallPods } ] =
198210 await Promise . all ( [
199211 launchSimulator ( bootedDevice ) ,
200212 buildApp ( {
@@ -207,6 +219,11 @@ ${devices
207219 binaryPath,
208220 } ) ,
209221 ] ) ;
222+ // After installing pods the fingerprint likely changes.
223+ // We update the artifact name to reflect the new fingerprint and store proper entry in the local cache.
224+ if ( didInstallPods ) {
225+ artifactName = await getArtifactName ( { silent : true } ) ;
226+ }
210227 saveLocalBuildCache ( artifactName , appPath ) ;
211228 if ( bootedDevice . type === 'simulator' ) {
212229 await runOnSimulator ( bootedDevice , appPath , infoPlistPath ) ;
0 commit comments