pulpgrinder edited a comment on issue #699:
URL: https://github.com/apache/cordova-ios/issues/699#issuecomment-917069481


   The suggestion from @Leandropintogit didn't quite work for me (iMac M1, 
XCode  12.5.1)... 
   
   While it enabled me to build the "My Mac (Designed for iPad)" configuration, 
it broke the "My Mac" and "My Mac  (Rosetta) builds.
   
   After diffing the script outputs from the three available Mac configurations 
and looking for different environment variables, I found an 
EFFECTIVE_PLATFORM_NAME environment variable. Checking whether this is set to 
"-maccatalyst" seems to do the trick. At least it builds and runs in all three 
configurations. No idea if this is the official Apple way of distinguishing or 
not, but it seems promising. Relevant lines from the works-for-me 
copy-www-build-step.sh file:
   
   ```
   SRC_DIR="www"
   DST_DIR="$BUILT_PRODUCTS_DIR/$FULL_PRODUCT_NAME"
   DST_DIR_WWW="$DST_DIR/www"
   if [[ "$EFFECTIVE_PLATFORM_NAME" == "-maccatalyst" ]]; then
     rm -rf "$DST_DIR_WWW"
     rm -f  "$DST_DIR/config.xml"
     DST_DIR="$BUILT_PRODUCTS_DIR/$FULL_PRODUCT_NAME/Contents/Resources"
     DST_DIR_WWW="$DST_DIR/www"
   fi
   
   COPY_HIDDEN=
   
   (etc.)
   ```
   
   Edit: this change does not appear to interfere with building for actual iOS. 
Seems to work for me on both the simulator and a physical phone. 
   
   Edit 2: reset DST_DIR_WWW based on new DST_DIR. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to