title: How to specify app id when upload to iTunesConnect using command line
body: <p><strong>Summary</strong></p>
  
  <p>I`m trying to automatize my applications upload to iTunesConnect.</p>
  
  <p>I have at least 6 apps and all are always "ready to upload".</p>
  
  <p>The problem is when I try to upload an app to iTunesConnect using command line, I have the following error message: </p>
  
  <p>"warning: There are more that one application pre-configured in iTunesConnect.  Only the first will be used.".</p>
  
  <p><strong>Questions</strong></p>
  
  <ul>
  <li>How can I know what is the first?</li>
  <li>Is there a way to set the first? </li>
  <li>Is there a way to specify which app I am trying to submit? How I am doing it?</li>
  </ul>
  
  <p><strong>Build Script...</strong></p>
  
  <pre><code>xcodebuild -target $TARGETNAME -configuration Release -sdk iphoneos clean build "CODE_SIGN_IDENTITY=iPhone Distribution: XXXXX..." "PROVISIONING_PROFILE=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
  
  xcrun -sdk iphoneos PackageApplication -v $CURRENTDIR/build/Release-iphoneos/$TARGETNAME.app -o $CURRENTDIR/Dist/$TARGETNAME.ipa --sign "iPhone Distribution: XXXXX..." --embed "path/to/XXXXX.mobileprovision"
  </code></pre>
  
  <p><strong>Upload Script...</strong></p>
  
  <pre><code>security add-generic-password -s Xcode:itunesconnect.apple.com -a user@email.com -w password -U
  
  xcrun -sdk iphoneos Validation -verbose -online -upload ./Dist/$TARGETNAME.ipa
  
  security delete-generic-password  -s Xcode:itunesconnect.apple.com -a user@email.com
  </code></pre>