In React Native I added
config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = "arm64"
Unsure why. I will remove that line and see if I can build.
Post
Replies
Boosts
Views
Activity
I want to manage the build number m myself. I am happy to call an API to set it before I run the Xcode Cloud build. Or setting a flag to tell Xcode Cloud to use my build number!
How do we et around this?
Bump ! Does Apple monitor these discussions forums?
Can we get a feature for this?
SetBuild Number from API
+1 how do we bundle different bundle Ids in XCODE CLOUD?
We need an API call in appstoreconnectapi to set build number - since we have 2 bundles and want the build numbers to be coordinated.
Why do we have 2 bundles? Since we want STAGE to be testable in Testflight and PROD to be testable in Testflight. And we want to distinguish them and not get confused.
I think you need to look thru all the scmGitReferences to find the branch one from previous run for your branch.
It looks like "canonicalName": "refs/heads/stage" for my branch stage.
{
"data": {
"type": "scmGitReferences",
"id": "6ce1ce69-c00b-46d1-8453-887f23b8JJHS",
"attributes": {
"name": "stage",
"canonicalName": "refs/heads/stage",
"isDeleted": false,
"kind": "BRANCH"
},
"links": {
"self": "https://api.appstoreconnect.apple.com/v1/scmGitReferences/6ce1ce69-c00b-46d1-8453-887f23b8JJHS"
}
},
"included": {}
}
This works for me
{
"sourceBranchOrTag": {
"data": {
"type": "scmGitReferences",
"id": "6ce1ce69-c00b-46d1-8453-887f23b8JJHS"
}
},
workflow: {
data: {
type: "ciWorkflows",
id: `${branch === 'stage' ? stageWorkflow : prodWorkflow}`
}
}
};
How did I get the IDs?
Start with your workflow:
const gitRef = await readAll('https://api.appstoreconnect.apple.com/v1/ciWorkflows/59D98329-2C36-4A9D-A657-B32EJUNK/relationships/repository');
console.log(JSON.stringify(gitRef, null, 2));
Then look at gitReferences:
const gitrepo = await readAll('https://api.appstoreconnect.apple.com/v1/scmRepositories/02604932-197a-48a0-b182-fa78f97JUNK/relationships/gitReferences');
console.log(JSON.stringify(gitrepo, null, 2));
then find the right one -- to see in detail:
const reference = await readAll('https://api.appstoreconnect.apple.com/v1/scmGitReferences/6ce1ce69-c00b-46d1-8453-887f23b8JJHS');
console.log(JSON.stringify(reference, null, 2));
You can do this with the API. First, change your bundle in Xcode, and click the Cloud to authenticate. Create the workflow on the bundle id. Then you can switch your Xcode back to old bundle. Then just use the App Store Connect web site to manage it.
Then to kick it off your pipeline (bitbucket or Azure Pipeline) can trigger the start on a branch using the appstoreconnectapi - start build number.
The results come back as:
data[].attributes.number and there are data[].attributes.startedDate etc...
OK I figured it out. Use:
https://api.appstoreconnect.apple.com/v1/ciProducts/<ID>/buildRuns
number - is the build Number.
BUT! Sorts are not documented on this, so - how do I sort by number newest to oldest? Something like ?sort=number desc
??
You can do this - because the api for app store connect supports submitting a build.
https://developer.apple.com/documentation/appstoreconnectapi/start_a_build
The feature we need is ability to set env variables and build number programmatically.
Yeah I am also testing adding to
ios/ci_scripts/ci_post_clone.sh
A way to change the bundle ID, and will report back.
Set the bundle ID
Setup Xcode in Cloud
See if ios/ci_scripts/ci_post_clone.sh will work to switch it