Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6606851
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:26:23+00:00 2026-05-25T19:26:23+00:00

I have a build script that pulls the old version out of the plist

  • 0

I have a build script that pulls the old version out of the plist for an iOs product, outputs it, then updates the plist. The two commands are

/usr/libexec/PlistBuddy -c Print CFBundleVersion ${LocationOfPList}
/usr/libexec/PlistBuddy -c Set :CFBundleVersion ${Version} ${LocationOfPList}

Run from the command line (with the version and the proper PList file location), everything is fine. Run from ant as

<exec executable="/usr/libexec/PlistBuddy" 
  outputproperty="CurrentVersion"
  errorproperty="PListError">
  <arg value="-c"/>
  <arg value ="Print :CFBundleVersion"/>
  <arg value="${LocationOfPList}"/>
</exec> 

<echo message="Fetched the last version in the plist: ${CurrentVersion}" />

<!-- Set the plist to the current build number -->
<exec executable="/usr/libexec/PlistBuddy"
  outputproperty="PListOutput"
  errorproperty="PListError"
>       
  <arg value="-c"/>
  <arg value ="Set :CFBundleVersion ${Version}" />              
  <arg value=" ${LocationOfPList}"/>
</exec>

<echo message="Output: ${PListOutput}"/>
<echo message="Errors: ${PListError}"/>
<echo message="Old version number: ${CurrentVersion} New Version Number: ${Version}" /> 

Results in some strange behavior. The first command works, the second fails. This ant script is running as the same user as the command line example. The output I see is:

[echo] Fetched the last version in the plist: 3.0.0
[exec] Result: 1
[echo] Output: File Doesn't Exist, Will Create:  /Users/macbuild/iPhone/branches/anttest/iChime/Program-Info.plist
[echo] Errors: 
[echo] Old version number: 3.0.0 New Version Number: anttest

The plist isn’t updated, and the only hit is a return code of 1. I’m the release engineer – I don’t know xcode. Does anyone see what I’m doing wrong here?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T19:26:24+00:00Added an answer on May 25, 2026 at 7:26 pm

    You’ve got a leading space just before the plist location in the set command:

     <!--        v -->
     <arg value=" ${LocationOfPList}"/>
    

    It’s one of those invisible errors – you might notice two spaces between “Will Create:” and “/Users” in the error message.
    Remove the space and it should work.

    Also, the PListError property is set to an empty string by the first exec, and Ant properties are immutable, hence no error text for the second exec.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ant build script that errors out with the following message. javac
We have a powershell build script that calls out to other scripts that is
I have an ant build script that needs to pull files down from a
I have a utility build script that gets called from a variety of project-specific
I have a build script and as part of that script it copies a
I have a nightly build DOS batch script that invokes devenv.exe to build a
I have a custom script step in my build process that zips the executable.
I have a Java project that I build using an Ant script. I am
I have a NAnt script that does a build and deployment of an ASP.Net
I have a build script fragment that looks as follows: foreach(...) ... add_custom_command( OUTPUT

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.