-
Notifications
You must be signed in to change notification settings - Fork 201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🔧 Make modifications so that the build can be done on the actual iPhone device. #759
🔧 Make modifications so that the build can be done on the actual iPhone device. #759
Conversation
I would like to merge this support as soon as possible, as it is inconvenient in its current state when doing Compose Multiplatform tasks. 🙏 |
@@ -193,7 +193,7 @@ | |||
); | |||
runOnlyForDeploymentPostprocessing = 0; | |||
shellPath = /bin/zsh; | |||
shellScript = "cd ${SRCROOT}/../..\n./gradlew assembleSharedXCFramework --no-configuration-cache\n./gradlew iosSimulatorArm64AggregateResources --no-configuration-cache\n\nRESOURCE_DIR=\"./app-ios-shared/build/kotlin-multiplatform-resources/aggregated-resources/iosSimulatorArm64\"\n\nmkdir ${RESOURCE_DIR}/compose-resources\ncp -R ${RESOURCE_DIR}/composeResources ${RESOURCE_DIR}/compose-resources\n"; | |||
shellScript = "cd ${SRCROOT}/../..\n\n./gradlew assembleSharedXCFramework --no-configuration-cache\n./gradlew iosSimulatorArm64AggregateResources --no-configuration-cache\n./gradlew iosArm64AggregateResources --no-configuration-cache\n\nSIMULATOR_RESOURCE_DIR=\"./app-ios-shared/build/kotlin-multiplatform-resources/aggregated-resources/iosSimulatorArm64\"\nDEVICE_RESOURCE_DIR=\"./app-ios-shared/build/kotlin-multiplatform-resources/aggregated-resources/iosArm64\"\n\nmkdir -p ${SIMULATOR_RESOURCE_DIR}/composeResources\nmkdir -p ${DEVICE_RESOURCE_DIR}/composeResources\n\nmkdir -p ${SIMULATOR_RESOURCE_DIR}/compose-resources\nmkdir -p ${DEVICE_RESOURCE_DIR}/compose-resources\n\ncp -R ${SIMULATOR_RESOURCE_DIR}/composeResources ${SIMULATOR_RESOURCE_DIR}/compose-resources\ncp -R ${DEVICE_RESOURCE_DIR}/composeResources ${DEVICE_RESOURCE_DIR}/compose-resources\n"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cd ${SRCROOT}/../..
./gradlew assembleSharedXCFramework --no-configuration-cache
./gradlew iosSimulatorArm64AggregateResources --no-configuration-cache
./gradlew iosArm64AggregateResources --no-configuration-cache
SIMULATOR_RESOURCE_DIR="./app-ios-shared/build/kotlin-multiplatform-resources/aggregated-resources/iosSimulatorArm64"
DEVICE_RESOURCE_DIR="./app-ios-shared/build/kotlin-multiplatform-resources/aggregated-resources/iosArm64"
mkdir -p ${SIMULATOR_RESOURCE_DIR}/composeResources
mkdir -p ${DEVICE_RESOURCE_DIR}/composeResources
mkdir -p ${SIMULATOR_RESOURCE_DIR}/compose-resources
mkdir -p ${DEVICE_RESOURCE_DIR}/compose-resources
cp -R ${SIMULATOR_RESOURCE_DIR}/composeResources ${SIMULATOR_RESOURCE_DIR}/compose-resources
cp -R ${DEVICE_RESOURCE_DIR}/composeResources ${DEVICE_RESOURCE_DIR}/compose-resources
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- If the “composeResources” directory is not created in advance, the cp command will fail.
- Therefore, the mkdir command has been added.
@@ -28,7 +28,7 @@ kotlin { | |||
binaryOption("bundleShortVersionString", version.toString()) | |||
|
|||
val includeToXCF = if (project.properties["app.ios.shared.debug"] == "true") { | |||
this.target.name == "iosSimulatorArm64" && this.debuggable | |||
(this.target.name == "iosSimulatorArm64" && this.debuggable) || (this.target.name == "iosArm64" && this.debuggable) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
./gradlew assembleSharedXCFramework --no-configuration-cache -Papp.ios.shared.debug=true
- The above command brings the simulator and the actual machine into the target.
> Configure project :
Project accessors enabled, but root project name not explicitly set for 'build-logic'. Checking out the project in different folders will impact the generated code and implicitly the buildscript classpath, breaking caching.
> Configure project :app-ios-shared
framework 'debugFramework target iosArm64 (native)' will be in XCFramework
framework 'debugFramework target iosSimulatorArm64 (native)' will be in XCFramework
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed that this has a trade-off: when we debug the app, the build takes twice as long. 😭
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about using -Papp.ios.shared.debug=false
when we want to debug on a device? Will -Papp.ios.shared.debug=false
take too much time?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@takahirom
I see...it is not good to lower the development performance of others just by adding XCFramework on an actual iPhone device. 😔
There are items that are difficult to check without an actual device, so I don't know what to do... 🤔 💭
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We actually have an issue here for deploying iOS app. Thank you for your contribution!
Issue
Overview (Required)