Note: Modify the configuration file, prepare the script, etc. before this stage, only need to do once. But the operation of this stage, for each need to debug the real machine to do the work once.
① Disabling the Xcode automatic signature operation
All of the Code signing options in the project configuration "Build Settings" are set to "T code sign".
② Add a custom post-build script in build phases, click the "+" sign in the upper-left corner, add a "New Run script Phase" and enter the following script:
Export codesign_allocate=/applications/xcode.app/contents/developer/platforms/iphoneos.platform/developer/usr/ Bin/codesign_allocate
if ["${platform_name}" = = "Iphoneos"] | | ["${platform_name}" = = "Ipados"]; Then
/applications/xcode.app/contents/developer/iphoneentitlements/gen_entitlements.py "My.company.${PROJECT_NAME}" " ${built_products_dir}/${wrapper_name}/${project_name}.xcent ";
Codesign-f-S "IPhone Developer"--entitlements "${built_products_dir}/${wrapper_name}/${project_name}.xcent" "${ built_products_dir}/${wrapper_name}/"
Fi
Shell Script Invocation error solution appears in Xcode real-time test
Solution:
See if the run script in build phase is written correctly, and you can delete it if necessary.
or tick the run script only when installing
iOS Real-Computer debugging