Last active
February 21, 2025 08:02
-
-
Save TalalMash/ea863e3a990d8d0ee0ed83160bf2ad76 to your computer and use it in GitHub Desktop.
Powershell: Convert Codemagic iOS debug artifact (--release) to unsigned IPA
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Set paths for your source zip file and destination zip file | |
$currentDir = Get-Location | |
$sourceZip = "$currentDir\Runner.app.zip" # Modify with the actual path | |
$destinationZip = "$currentDir\Payload.zip" # Modify with the desired path for the zip | |
$finalIpa = "$currentDir\Payload.ipa" # Modify with the final desired path for the .ipa file | |
# Create a temporary extraction folder in the current directory | |
$tempDir = "$currentDir\temp_extracted" | |
$payloadDir = "$tempDir\Payload" | |
# Make sure temp directory exists, if not, create it | |
if (-Not (Test-Path -Path $tempDir)) { | |
New-Item -Path $tempDir -ItemType Directory | |
} | |
# Extract the original zip file | |
Write-Host "Extracting Runner.app.zip..." | |
Expand-Archive -Path $sourceZip -DestinationPath $tempDir | |
# Create Payload directory | |
Write-Host "Creating Payload directory..." | |
New-Item -Force -Path $payloadDir -ItemType Directory | |
# Move the Runner.app folder inside the Payload folder | |
Write-Host "Moving Runner.app to Payload folder..." | |
Move-Item -Path "$tempDir\Runner.app" -Destination $payloadDir | |
# Create a new zip file with the structure Payload > Runner.app | |
Write-Host "Creating Payload.zip..." | |
Compress-Archive -Force -Path "$tempDir\Payload" -DestinationPath $destinationZip | |
# Rename Payload.zip to Payload.ipa | |
Remove-Item $finalIpa | |
Write-Host "Renaming Payload.zip to Payload.ipa..." | |
Rename-Item -Path $destinationZip -NewName $finalIpa | |
# Clean up the temporary extraction folder | |
Write-Host "Cleaning up temporary files..." | |
Remove-Item -Recurse -Force $tempDir | |
Write-Host "Operation complete! The final Payload.ipa is located at $finalIpa" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment