I am currently trying to use ALTool to upload my application IPA to App Store Connect as part of a build script.
These are the commands I am using:
xcrun altool --validate-app -f my-ipa-file.ipa -t ios --apiKey "MYAPIKEY" --apiIssuer "MYISSUERID"
xcrun altool --upload-app -f my-ipa-file.ipa -t ios --apiKey "MYAPIKEY" --apiIssuer "MYISSUERID"
My private key (p8) is located at
./private_keys/AuthKey_MYAPIKEY.p8
According to the altool --help command the tool will look in the following directories (in order) for a p8 file named AuthKey_<apikey>.p8:
./private_keys
~/private_keys
~/.private_keys
~/.appstoreconnect/private_keys
Considering the p8 file is in the first folder of that list, this should work.
And for the --validate-app call, it does actually work. The calls to App Store Connect are made, the app validates and if there are any errors from App Store Connect they return as expected.
However, for some reason the --upload-app command always returns with the same error:
2020-09-01 14:24:40.934 altool[28265:119010] * Error: Error uploading 'my-ipa-file.ipa'.
2020-09-01 14:24:40.934 altool[28265:119010] * Error: code -18000 (Could not locate the private key file: AuthKey_MYAPIKEY.p8)
For some reason it seems --upload-app doesn't properly load the p8 file in ./private_keys/ while --validate-app does.
Placing the p8 file in one of the other 3 folders (~/private_keys etc.) does work for both validate and upload as a temporary workaround. But I prefer to use ./private_keys due to how my build scripts injects files into the build process.
Is this a bug in altool or is there something I'm missing?
In GitHub actions I just put the api key into $RUNNER_TEMP. And then when running the xcrun altool I am doing it like so:
API_PRIVATE_KEYS_DIR=$RUNNER_TEMP xcrun altool
This is probably a bug.
When uploading an app, altool seems to invoke iTMSTransporter under the hood to do the actual uploading.
The latter changes current directory before running, so when it looks for ./private_keys/AuthKey_MYAPIKEY.p8 in current directory, it checks the wrong location.
See cd in /Applications/Xcode.app/Contents/SharedFrameworks/ContentDeliveryServices.framework/itms/bin/iTMSTransporter.
I guess altool doesn't invoke iTMSTransporter when validating apps.
Related
I changed my app deployment version from iOS 13 to iOS 14 and I am getting an error building the app.
It keeps talking about no credentials provided although all these packages are public. Also I have github credentials set up and use them all the time.
I have tried removing github account, changing ssh -> http, but nothing seems to help.
Same issue happens when I try to add a new public package using Swift Package Manager
Any suggestions?
I had a similar issue, the error I was receiving was:
xcodebuild: error: Could not resolve package dependencies:
Authentication failed because the credentials were missing.
artifact not found for target 'AddonManager'.
The solution was to generate my SSH key using RSA instead of Ed25519, it seems like Xcode couldn't read my SSH key in the Ed25519 format.
I re-generated my SSH using the legacy RSA algorithm (as noted in the github docs) and added it to my local machine, this fixed the error on the next build.
https://docs.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent
Check your git config file first write your terminal: git config --global --edit
and it is supposed to be there "https://github.com/: rather than url.git#github.com.
I have to download some files from azure to local, using a Mac.
I have been given this Windows command line:
AzCopy /Source:https://XXX.blob.core.windows.net/YYY /SourceKey:TQSxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxpbA== /Dest:C:\myfolder /Pattern:c /S
I have downloaded and installed azcopy, but it has a radically different syntax, and despite I've been trying for quite some time, I haven't been able to make it work.
What's the correct syntax, given this one?
Looking at some documentation, I've tried:
azcopy cp "https://XXX.blob.core.windows.net/YYY/TQSxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxpbA==" "azcopy_dest" --recursive
but it doesn't work:
failed to perform copy command due to error:
cannot start job due to error: cannot list blobs for download. Failed
with error ->
github.com/Azure/azure-storage-azcopy/vendor/github.com/Azure/azure-storage-blob-go/azblob.NewResponseError,
/go/src/github.com/Azure/azure-storage-azcopy/vendor/github.com/Azure/azure-storage-blob-go/azblob/zz_generated_response_error.go:28
===== RESPONSE ERROR (ServiceCode=ResourceNotFound) ===== Description=The specified resource does not exist.
From you description it seems you are using AZCopy 10, which mean you do not need to specify key. You either need to generate a SAS token or Login before using azcopy.
create a token
azcopy cp "https://XXX.blob.core.windows.net/YYY?[SAS]" "/path/to/dir" --recursive=true
Login azcopy login --tenant-id "your tenantid"
azcopy cp "https://XXX.blob.core.windows.net/YYY" "/path/to/dir" --recursive=true
Used Linux, do not have a Mac but should be the same across all platform.
Hope this helps.
I am trying to setup Continuous Integration for IOS App using altool to upload IPA file to Test Flight. We have Two apps in one user Account. Now I want to upload two Different IPA's into their builds. But I couldn't found any command to do that.
Command:
$/Applications/Xcode.app/Contents/Applications/Application\Loader.app/Contents/Frameworks/ITunesSoftwareService.framework/Support/altool
$ altool --upload-app -f /path/to/app.ipa -u USERNAME -p PASSWORD
how do I upload two different App's(IPA) in one user account using altool.
You can upload app's using altool.
Write below script/commnd in Execute Shell of Add Build Step drop down.
In the first step you need to go to the path where ALTOOL is. (Note :- Make sure your Xcode version is greater than or equal to 8.3)
In second step perform commnd for upload app to testflight.
cd /Applications/Xcode8.3.3/Xcode.app/Contents/Applications/Application\ Loader.app/Contents/Frameworks/ITunesSoftwareService.framework/Versions/A/Support/
./altool --upload-app -f PathOfYourIPA -u yourAccountID -p yourAccountPassword
For ex. My Path for IPA is :-
/Users/Shared/Jenkins/Home/workspace/JOB_NAME/build/artifacts/IPAName.ipa
I'm really going mad with this problem! I have an app that contains a simple Helper app which manages the login item for the Main app.
When I try to submit the app I get errors related to the provisioning profile and the entitlements. I'm sure that the problem is related with the Helper app because before than I added it the submission worked with no problem.
At the moment the helper app is code signed and is sandboxed as the main app.
The errors are :
Invalid provisioning profile. The provisioning profile included in the bundle is invalid
Invalid Code Signing Entitlements. The entitlements in your app bundle signature do not match the one that are contained in the provisioning profile. The bundle contains a key that is not included in the provisioning profile 'com.apple.application-identifier' in 'myapp.app/Contents/Library/LoginItems/helper.app'
Invalid Code Signing Entitlements. The entitlements in your app bundle signature do not match the one that are contained in the provisioning profile. The bundle contains a key that is not included in the provisioning profile 'com.apple.application-identifier' in 'myapp.app/Contents/MacOS/myapp'
For anyone else coming across this problem, you don't have to codesign the helper app a second time, just remove the "embedded.provisionprofile" from the helper app in the xarchive and you can submit no problem.
The only solution that seems to solve this problem was codesign and sandboxing the helper app from Xcode and then:
Re-Codesign the Helper app from terminal
codesign -f -s "3rd Party mac Developer Application:" -i
"com.bundle.YOUR.HELPER" --entitlements path/to/helper/entitlements
YEOR-HELPER.app
Remove provisioning profile from Helper app, adding a "Run script" into the "Build Phases"
rm"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/Contents/Library/LoginItems/YOUR-HELPER.app/Contents/embedded.provisionprofile"
With this solution we've correctly submitted our App.
I had the 3rd error when I accidentally included some 3rd-party .a files in my target. (They're needed for non-App Store distribution but I'd forgotten to exclude them for the App Store build). The error wasn't too helpful in tracking this down!
I was finally able to resolve this problem by deleting the embedded.provisionprofile file from the helper app by adding the following run script:
if [ -f "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/Contents/embedded.provisionprofile" ];
then
rm "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/Contents/embedded.provisionprofile"
echo "Removed embedded provisioning profile."
else
echo "No profile found"
fi
Since recently Apple changed the iTunes Connect interface, and people are required to upload apps with the Application Loader.
That's nice but I need a script for automating my work.
How can an app like App Loader be automated?
I was thinking of something written in AppleScript ... but I don't know what actions it exposes (if any). Found somewhere that I could also do GUI scripting from within AppleScript, but I can't find docs on that.
What I need ... some way to trigger input actions (mouse clicks / keyboard input) and read the text from the various controls displayed.
If that would be possible in Python/Ruby it would be great, but AppleScript is fine.
OS X is version 10.6.4.
Any suggestions are appreciated.
Thanks,
Application Loader documentation mentions an altool which can be used for this purpose. (https://itunesconnect.apple.com/docs/UsingApplicationLoader.pdf)
The relevant information:
You can use altool, Application Loader’s command-line tool for
validating and uploading your application binary files to the App
Store.
To validate your build before upload or to automate uploads of valid
builds to the App Store, you can include altool in your continuous
integration systems. altool is located in the Application
Loader.app/Contents/Frameworks/ITunesSoftwareService.framework/Versions/A/Support/
folder. (So full path would be
/Applications/Xcode.app/Contents/Applications/Application\
Loader.app/Contents/Frameworks/ITunesSoftwareService.framework/Support/altool)
To run altool, specify one of the following at the command-line:
$ altool --validate-app -f file -u username [-p password]
[--output-format xml]
$ altool --upload-app -f file -u username [-p
password] [--output-format xml]
Where:
--validate-app Specifies you want to validate the specified application.
--upload-app Specifies you want to upload the specified application.
-f file Specifies the path and filename for the application you are validating or uploading.
-u username Specifies your username (Apple ID).
-p password Specifies your user password.
--output-format [xml | normal] Specifies that you want Application Loader to return output in structured XML format or unstructured text
format. By default, Application Loader returns output information in text format.
In order to see what Applescript commands any application supports, then you need to look at the Dictionary for the application. From my answer to a similar question posted just the other day:
To get to an application's Dictionary in the the Applescript Editor go to File > Open Dictionary.... A list of all the applications that the OS knows supports Applescript will appear, but the OS won't catch them all so you can use the Browse button. If an application doesn't support Applescript, then it won't be selectable in the dialog window.
The caveat to this is that there are certain commands that an application is supposed to support but don't, or an application may only support the minimum requirements. These are all very, very simple like open, quit, etc. Your mileage may vary.
Information to start with GUI scripting can be found on the OS X Automation site. GUI Scripting is a funky way to go, and I don't think you can get the values of onscreen controls, instead only set them. You should only do this if no other avenue works.
If you wish to stick with Python, then you can look at the py-appscript project, but this is still dependent on Applescript support of the application.
You can use any of these commands either one by one or all in one bash script to actually automate your Archive, Extract and Upload process to the AppStore Connect.
ARCHIVE
xcodebuild -workspace "${APP_NAME}.xcworkspace" -scheme "${APP_NAME}" clean archive -configuration release -sdk iphoneos -archivePath ".build/${TEMP_BUILD}.xcarchive"
EXPORT TO IPA
xcodebuild -exportArchive -archivePath ".build/${TEMP_BUILD}.xcarchive" -exportOptionsPlist "ExportOptions.plist" -exportPath ".build/${TEMP_BUILD}.ipa"
UPLOAD IPA TO TESTFLIGHT
altool --upload-app -f ".build/${TEMP_BUILD}.ipa/${APP_NAME}.ipa" -u $APP_STORE_USERNAME -p $APP_STORE_PASSWORD
1) If you don't know what should be your ExportOptions.plist file just
take a look here.
2) To use altool from anywhere in the terminal you could add it to your
PATH env variable by typing in terminal:
MacBook-Pro:~ denis$ export PATH=$PATH:/Applications/Xcode.app/Contents/Applications/Application\ Loader.app/Contents/Frameworks/ITunesSoftwareService.framework/Support/
MacBook-Pro:~ denis$ source ~/.bash_profile