Como localizar o comando de build no App Center
Importante
O Visual Studio App Center está programado para ser desativado em 31 de março de 2025. Embora você possa continuar a usar o Visual Studio App Center até que ele seja totalmente desativado, há várias alternativas recomendadas para as quais você pode considerar migrar.
Às vezes, é útil comparar o comando de build exato executado em diferentes builds.
Para comparar comandos, ajuda saber onde procurar nos logs do App Center. A aparência dos comandos e como encontrá-los depende da estrutura do aplicativo.
Nativo
Android (Java/Gradle)
Aqui está um exemplo de saída de um build nativo do Android:
=====================================================================
Task : Gradle
Description : Build using a Gradle wrapper script
Version : 1.128.0
Author : Microsoft Corporation
Help : More Information
=====================================================================
SYSTEMVSSCONNECTION exists true
[command]/Users/vsts/agent/2.150.0/work/1/s/gradlew -DMOBILECENTER_KEYSTORE_PASSWORD=*** -DMOBILECENTER_KEY_ALIAS=*** -DMOBILECENTER_KEY_PASSWORD=*** -DMOBILECENTER_BUILD_VERSION=12 -DAPPCENTER_KEYSTORE_PASSWORD=*** -DAPPCENTER_KEY_ALIAS=*** -DAPPCENTER_KEY_PASSWORD=*** -DAPPCENTER_BUILD_VERSION=12 clean :app:assembleRelease :app:testRelease :app:lintRelease
iOS (Objective-C/Swift)
Aqui está um exemplo de saída de um build nativo do iOS:
=====================================================================
Task : Xcode
Description : Build, test, or archive an Xcode workspace on macOS. Optionally package an app.
Version : 4.130.0
Author : Microsoft Corporation
Help : More Information
=====================================================================
[command]/usr/bin/xcodebuild -version
Xcode 10.2
Build version 10E125
[command]/usr/bin/xcodebuild -sdk iphoneos -workspace /Users/vsts/agent/2.149.2/work/1/s/SampleiOS.xcworkspace -scheme SampleiOS clean DSTROOT=/Users/vsts/agent/2.149.2/work/1/output/build/build.dst OBJROOT=/Users/vsts/agent/2.149.2/work/1/output/build/build.obj SYMROOT=/Users/vsts/agent/2.149.2/work/1/output/build/build.sym SHARED_PRECOMPS_DIR=/Users/vsts/agent/2.149.2/work/1/output/build/build.pch CODE_SIGN_STYLE=Manual
React Native
Observação
Para reproduzir localmente, instale também as dependências do pacote do arquivo package.json:
- Usando npm –
npm install
- Usando yarn –
yarn install
Android
Como React Native links para o SDK do Android a serem compilados, a saída será semelhante a um aplicativo Android nativo:
=====================================================================
Task : Gradle
Description : Build using a Gradle wrapper script
Version : 1.128.0
Author : Microsoft Corporation
Help : More Information
=====================================================================
SYSTEMVSSCONNECTION exists true
[command]/Users/vsts/agent/2.149.2/work/1/s/android/gradlew -DMOBILECENTER_BUILD_VERSION=5 -DAPPCENTER_BUILD_VERSION=5 -p android clean :app:assembleRelease :app:lintRelease
iOS
Como React Native links para xcode para compilar, a saída dele será semelhante à de um aplicativo iOS nativo:
=====================================================================
Task : Xcode
Description : Build, test, or archive an Xcode workspace on macOS. Optionally package an app.
Version : 4.130.0
Author : Microsoft Corporation
Help : More Information
=====================================================================
[command]/usr/bin/xcodebuild -version
Xcode 10.2
Build version 10E125
##[warning]Output directory for build output (binaries) ignored. Specifying an output directory is incompatible with the 'archive' action.
[command]/usr/bin/xcodebuild -sdk iphoneos -project /Users/vsts/agent/2.149.2/work/1/s/ios/SampleReactNative.xcodeproj -scheme SampleReactNative clean archive -archivePath /Users/vsts/agent/2.149.2/work/1/output/build/archive/SampleReactNative.xcarchive -UseModernBuildSystem=NO CODE_SIGNING_ALLOWED=NO
Xamarin
Android
Aqui está um exemplo de saída de um build do Xamarin.Android. As linhas-chave a serem examinadas estão atrás dos [command]
colchetes, embora o título seja útil para ajudá-lo a encontrar o local correto.
=====================================================================
Task : Xamarin.Android
Description : Build an Android app with Xamarin
Version : 1.151.0
Author : Microsoft Corporation
Help : More Information
=====================================================================
[command]/Library/Frameworks/Mono.framework/Versions/5_18_2/bin/msbuild /version /nologo
[command]/Library/Frameworks/Mono.framework/Versions/5_18_2/bin/msbuild /Users/vsts/agent/2.150.3/work/1/s/Xamarin.UITest/FormsGallery/FormsGallery/FormsGallery.Android/FormsGallery.Android.csproj /t:PackageForAndroid /p:Configuration=Debug
iOS
O Xamarin.iOS é quase idêntico no formato , exceto que as referências a Android
são para iOS
:
=====================================================================
Task : Xamarin.iOS
Description : Build an iOS app with Xamarin on macOS
Version : 1.131.0
Author : Microsoft Corporation
Help : More Information
=====================================================================
[command]/Library/Frameworks/Mono.framework/Versions/5_18_2/bin/msbuild /version /nologo
[command]/Library/Frameworks/Mono.framework/Versions/5_18_2/bin/msbuild /Users/vsts/agent/2.150.3/work/1/s/Xamarin.UITest/FormsGallery/FormsGallery.sln /p:Configuration=Debug /p:Platform=iPhoneSimulator /t:Rebuild