@@ -107,7 +107,8 @@ export const createRun = async (
107107 ) ;
108108
109109 if ( platformName === 'macos' ) {
110- if ( ! args . binaryPath ) {
110+ let appPath = args . binaryPath ;
111+ if ( ! appPath ) {
111112 await buildProject ( {
112113 xcodeProject,
113114 sourceDir,
@@ -117,20 +118,21 @@ export const createRun = async (
117118 configuration,
118119 args,
119120 } ) ;
121+ const buildSettings = await getBuildSettings (
122+ xcodeProject ,
123+ sourceDir ,
124+ configuration ,
125+ getSimulatorPlatformSDK ( platformName ) ,
126+ scheme
127+ ) ;
128+ appPath = buildSettings . appPath ;
120129 }
121- const buildSettings = await getBuildSettings (
122- xcodeProject ,
123- sourceDir ,
124- configuration ,
125- getSimulatorPlatformSDK ( platformName ) ,
126- scheme
127- ) ;
128- const appPath = args . binaryPath ?? buildSettings . appPath ;
129130 await runOnMac ( appPath ) ;
130131 outro ( 'Success 🎉.' ) ;
131132 return ;
132133 } else if ( args . catalyst ) {
133- if ( ! args . binaryPath ) {
134+ let appPath = args . binaryPath ;
135+ if ( ! appPath ) {
134136 await buildProject ( {
135137 xcodeProject,
136138 sourceDir,
@@ -140,15 +142,15 @@ export const createRun = async (
140142 configuration,
141143 args,
142144 } ) ;
145+ const buildSettings = await getBuildSettings (
146+ xcodeProject ,
147+ sourceDir ,
148+ configuration ,
149+ getSimulatorPlatformSDK ( platformName ) ,
150+ scheme
151+ ) ;
152+ appPath = buildSettings . appPath ;
143153 }
144- const buildSettings = await getBuildSettings (
145- xcodeProject ,
146- sourceDir ,
147- configuration ,
148- getSimulatorPlatformSDK ( platformName ) ,
149- scheme
150- ) ;
151- const appPath = args . binaryPath ?? buildSettings . appPath ;
152154 await runOnMacCatalyst ( appPath , scheme ) ;
153155 outro ( 'Success 🎉.' ) ;
154156 return ;
@@ -191,7 +193,8 @@ export const createRun = async (
191193 const infoPlistPath = buildSettings . infoPlistPath ;
192194 await runOnSimulator ( device , appPath , infoPlistPath ) ;
193195 } else if ( device . type === 'device' ) {
194- if ( ! args . binaryPath ) {
196+ let appPath = args . binaryPath ;
197+ if ( ! appPath ) {
195198 await buildProject ( {
196199 xcodeProject,
197200 sourceDir,
@@ -201,15 +204,15 @@ export const createRun = async (
201204 configuration,
202205 args,
203206 } ) ;
207+ const buildSettings = await getBuildSettings (
208+ xcodeProject ,
209+ sourceDir ,
210+ configuration ,
211+ getDevicePlatformSDK ( platformName ) ,
212+ scheme
213+ ) ;
214+ appPath = buildSettings . appPath ;
204215 }
205- const buildSettings = await getBuildSettings (
206- xcodeProject ,
207- sourceDir ,
208- configuration ,
209- getDevicePlatformSDK ( platformName ) ,
210- scheme
211- ) ;
212- const appPath = args . binaryPath ?? buildSettings . appPath ;
213216 await runOnDevice ( device , appPath , sourceDir ) ;
214217 }
215218 outro ( 'Success 🎉.' ) ;
0 commit comments