When I try to publish using following command, it's giving me error. I searched around and didn't find anything on google.
Command:
tns publish ios <apple id> <password> --appleApplicationSpecificPassword <app specific pass> --ipa <ipa file path>
Error message that I'm getting from nativescript cli:
Although response from Apple indicated activated Two-step Verification or Two-factor Authentication, NativeScript CLI don't know how to handle this response: [object Object]
Would appreciate any help. Thank you!
Try to this configuration:-
1.Set apple app store configuration in
App_Resources -> iOS -> build.xcconfig
2.Create Release IPA File With Bundle
cmd:-
tns build ios --for-device --release --bundle --env.uglify --env.*
3.Create IPA With Distribution Provision
cmd:-
tns build ios --for-device --release --provision < provision-UUID > --bundle webpack --env.uglify--env.*
OR
4.Upload IPA Package and build on App Store With Bundle
cmd:-
tns appstore upload --bundle < AppleID > < AppleID-Specific-Password > < provision-distribution-UUID > "iOS Distribution"
Finally had to resort to :
xcrun altool --upload-app --type ios --file "$IPA_PATH" --username "$APP_STORE_USERNAME" --password "$APP_SPECIFIC_PASSWORD"
Doing so uploaded my ipa file to app store connect.
Related
this is some part of my script for uploading the app to appcenter from Xcode Cloud:
1. $brew install npm
2. $npm install -g appcenter-cli
3. $appcenter login --token [my-token]
4. $appcenter distribute release -f $CI_AD_HOC_SIGNED_APP_PATH/MyApp.ipa -g Collaborator --app UserName/App --release-notes-file releaseNote.txt
but I got this error at 3:
Error: Could not add password to keychain: security: SecKeychainItemCreateFromContent (<default>): User interaction is not allowed.
how can I add the password to the Xcode Cloud keychain?
Don't need to save password and login to the app center in Xcode Cloud
appcenter distribute release has an option for adding token
I removed appcenter login --token [my-token]
and taken added to appcenter distribute release -f $CI_AD_HOC_SIGNED_APP_PATH/MyApp.ipa -g Collaborator --app UserName/App --release-notes-file releaseNote.txt --token [my-token]
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.
My situation: Jenkins runs a Fastlane script as a root user which builds the macOS project (Release configuration).
There is a build phase:
if [ "${CONFIGURATION}" = "Release" ]; then
echo 'Crashlytics executing...'
"${PROJECT_DIR}/Frameworks/Fabric.framework/run" xxx yyy
echo 'Crashlytics run completed.'
fi
In the Console Output, there is a line:
▸ Running script 'Crashlytics'
but the actual dSYM never gets uploaded as I always have to manually drop it in the fabric.io dSYM upload page.
Did anyone have similar issues?
What would be acceptable for me is if I could use the uploadDSYM script to upload dSYM but trying to run it reports an error like:
warning: using uploadDSYM directly to upload dSYMs is not supported. uploadDSYM will be deprecated in a future release.error: Fabric: Failed to Detect Build Environment
I am trying to follow this post for setting up a staging environment for my react native app. The post asks to add a new configuration calling Staging to the Xcode project and use that to build the project. I added the Staging config which is a duplicate of the Release config but I am not able to build the app using that config. I get following errors:
React/RCTBridgeModule.h file not found
I don't get this error in Debug and Release configuration. I read that react-native assigns special meaning to configurations name Debug and Release but I am not sure how to get around this problem. I also looked at react-native-config for setting up the staging environment but the initial setup looked a bit complicated to me and something that I didn't understand right away. Whereas the steps listed in the other post are pretty simple to understand which are basically to create a separate config and use the config used to run the app to figure out the environment that the app is running in.
If you have been able to create a staging environment for your react-native app using this approach or some other approach, please share.
Thanks!
I think you should look at this post https://github.com/Microsoft/react-native-code-push#ios
And my way to do it:
Install code-push
First, install the CodePush CLI:
npm install -g code-push-cli
Then go to root of your React Native project and use command line:
npm install --save react-native-code-push
Then link the libraries:
react-native link react-native-code-push
After that, we need to login in code-push with our account (you could find Mobile Center account here):
code-push login
You also could check if you're already logged in by using command:
code-push whoami
Create Deployment Keys
Before we deploy any updates, we need to register an app with the CodePush service using the following command:
code-push app add <appName> <os> <platform>
For example:
code-push app add myapp-ios ios react-native
code-push app add my-android android react-native
After then you should see what you just added in Mobile Center https://mobile.azure.com/apps
And next step is checking the Deployment Key by typing command line:
code-push deployment ls <appName> -k
For example:
code-push deployment ls myapp-ios -k
code-push deployment ls myapp-android -k
Link Deployment Key
To release an update we need to link Deployment Key to React Native project.
https://github.com/Microsoft/react-native-code-push#ios
Release an update
After Deployment Key is finally setting up, the last step is upload the first update.
Change index.ios.js and index.android.js file into:
import codePush from "react-native-code-push";
let codePushOptions = {
checkFrequency: codePush.CheckFrequency.ON_APP_RESUME,
installMode: codePush.InstallMode.ON_NEXT_RESUME,
};
class MyApp extends Component {
...
}
export default MyApp = codePush(codePushOptions)(MyApp);
And now type the command line:
code-push release-react <appName> <platform>
e.g.
code-push release-react myapp-ios ios
code-push release-react myapp-android android
After this step you will see the first version is uploading to Mobile Center
The rest is now getting very easy. Anytime we want to do an update, we just need to type code-push release-react command line and the code-push will do the silent update.
Push staging to Production also just one command job:
code-push promote <APP_NAME> Staging Production -r 100%
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