프로젝트에서 코코아 포드를 제거하는 방법은 무엇입니까?
프로젝트에서 코코아 포드를 제거하는 올바른 방법은 무엇입니까?코코아 포드 전체를 제거하고 싶습니다.제 고객이 부과한 제한 사항 때문에 사용할 수 없습니다.나는 xc 작업 공간 대신 하나의 xcode proj만 있으면 됩니다.
프로젝트에서 코코아 포드를 제거할 수 있지만 현재 CLI에 의해 자동화되지는 않습니다.첫 번째로, 당신이 가지고 있는 유일한 문제가 사용할 수 없는 것이라면xcworkspace당신은 단지 카카오팟을 사용할 수 있습니다.xcodeprojs를 생산할 깃발을 사용함으로써.Pods.xcodeproj작업 공간이 아닙니다.그러면 이것을 추가할 수 있습니다.xcodeproj당신의 주요 프로젝트의 하위 프로젝트로서.xcodeproj.
모든 코코아 포드 통합을 제거하려면 몇 가지 작업을 수행해야 합니다.
이러한 작업 중 일부를 잘못 편집하면 기본 프로젝트가 중단될 수 있습니다.만약을 대비해서 당신의 프로젝트를 소스 컨트롤로 확인할 것을 강력히 권장합니다.또한 이 지침은 코코아 포드 버전을 위한 것입니다.0.39.0그들은 새로운 버전으로 바뀔 수 있습니다.
- 파일을 합니다.
PodfilePodfile.lock그리고 당신의Pods - 된 을 합니다.
xcworkspace - .
xcodeproj일파, 참삭에 대한 합니다.Pods.xcconfig그리고.libPods.a(()에Frameworks - 의 의너에 아래에서.
Build Phases를 합니다.Copy Pods Resources,Embed Pods Frameworks그리고.Check Pods Manifest.lock단계의 - 이것은 분명해 보이지만 다른 방법으로 타사 라이브러리를 통합하거나 코드에서 타사 라이브러리에 대한 참조를 제거해야 합니다.
의 이한단후단설합니야다정해로으일에러계는으로 입니다.xcodeproj코코아 포드를 통합하기 전에 존재했던 것입니다.누락된 내용이 있으면 알려주시면 수정하겠습니다.
또한 항상 코코아 포드를 개선하는 방법에 대한 제안을 찾고 있으므로 문제가 있는 경우 문제를 해결할 방법을 찾을 수 있도록 문제 추적기에 제출해 주십시오!
편집
Jack Wu가 댓글에 표시한 것처럼 이러한 단계를 자동화할 수 있는 타사 CocoPods 플러그인이 있습니다.이것은 여기에서 찾을 수 있습니다.이 플러그인은 타사 플러그인이며 코코아 포드가 업데이트될 때마다 업데이트되지 않을 수 있습니다.또한 문제가 발생하지 않도록 CocoaPods의 핵심 팀원이 제작한 것입니다.
pod deintegrate그리고.pod clean는 프로젝트/리포에서 코코아 포드를 제거하기 위한 두 가지 지정된 명령입니다.
다음은 전체 명령 집합입니다.
$ sudo gem install cocoapods-deintegrate cocoapods-clean
$ pod deintegrate
$ pod cache clean --all
$ rm Podfile
원래 솔루션은 여기에서 찾을 수 있습니다. https://medium.com/ @icanhazedit/remove-modules-deintegrated-modafods-from-your-xcode-ios-project-c4621ce5e42#.wd00fj2e5
코아포설에 있는 :pod deintegrate: https://guides.cocoapods.org/terminal/commands.html#pod_deintegrate
프로젝트에서 포드를 완전히 제거하려면 먼저 두 가지를 설치해야 합니다.다음은 (시스템에 코코아 포드가 이미 설치되어 있다고 가정할 때)...
- Cocoapods-통합 해제 플러그인
- Cocoapods-Clean 플러그인
설치
Cocoapods-통합 해제 플러그인
터미널에서 다음 명령을 사용하여 터미널을 설치합니다.
sudo gem install cocoapods-deintegrateCocoapods-Clean 플러그인
터미널에서 다음 명령을 사용하여 터미널을 설치합니다.
sudo gem install cocoapods-clean
사용.
먼저 다음과 같은 일반적인 명령을 사용하여 프로젝트 폴더로 이동합니다.
cd (path of the project) //Remove the braces after cd
이제 두 플러그인을 사용하여 다음과 같이 플러그인을 완전히 제거합니다.
Cocoapods-통합 해제 플러그인
터미널에서 다음 명령을 사용하여 프로젝트에서 포드를 먼저 분리합니다.
pod deintegrate
Cocoapods-Clean 플러그인
프로젝트에서 포드를 분리한 후 터미널에서 다음 명령을 사용하여 포드를 완전히 청소합니다.
pod clean위의 작업을 완료한 후에도 프로젝트 디렉토리에 포드 파일이 남아 있을 것입니다.수동으로 삭제하거나 터미널에서 다음 명령을 사용합니다.
rm Podfile
그게...이제 당신의 프로젝트는 포드로부터 자유로워졌습니다...청소했다.
시스템에서 Cocoapod를 제거하는 중입니다.
어쨌든 터미널에서 다음 명령을 사용하여 시스템에서 코카팟을 제거하거나 제거해 보십시오.
sudo gem uninstall cocoapods
그것은 자동으로 코카팟을 제거할 것입니다.
감사합니다. 도움이 되길 바랍니다.
좀 더 쉬운 방법이 있을 것 같습니다.
승인된 답변에서 편집한 대로 이제 타사 플러그인 cocoapods-deintegrated를 사용할 수 있습니다. 이는 CocoaPods 핵심 팀원이 만든 것이기 때문에 신뢰할 수 있습니다.
그러나 다음과 같은 파일이 남아 있습니다.
Podfile
Podfile.lock
Workspace
프로젝트에서 수동으로 제거할 수도 있지만, 고치를 깨끗하게 청소하는 데 도움이 되는 다른 도구도 있습니다.
되지 않았습니다.cocoapods-clean하지 Podfile그냥 실행:
rm Podfile
건배!
제거하기 전에 프로젝트의 백업이 있는지 확인해야 합니다!
pod deintegrate
이 cmd 이후에는 프로젝트에 Cocoapod의 흔적이 남지 않습니다.
그러나 Pods 프로젝트를 참조하는 작업 공간은 여전히 남아 있으므로 아래의 3개 파일을 수동으로 제거해야 합니다.
xx.xc 작업 공간
포디플
Podfile.lock
그러면 프로젝트를 다시 사용할 수 있습니다.
재미있게 보내!
코코아 포드 버전 테스트 = 1.2.0
저는 이 모든 답을 시도했지만 여전히 구축되지 않았고, 결국 시도했습니다.
pod deintegrate
pod install
그것은 실제로 효과가 있었습니다!
이는 마치 빌드 단계에서 모든 포드 스크립트를 제거한 후 다시 추가해야 하는 것과 같습니다. 적어도 제 경우에는 말이죠.
터미널 CD에서 프로젝트 폴더로 이동합니다.아래 단계는 프로젝트에서 포드를 분리하는 데 도움이 됩니다.
$ sudo gem install cocoapods-deintegrate cocoapods-clean
$ pod deintegrate
$ pod clean
$ rm Podfile
그런 다음 프로젝트 파일을 열고 여전히 빨간색으로 Project Explorer에 있는 경우 Pod 폴더를 제거합니다.프로젝트 빌드...준비됐어요!!!
Keith의 대답은 훌륭합니다. Cocoapods 0.36이 Dynamic Frameworks를 지원하기 시작했기 때문에 'Podfile'에서 'use_frameworks!'를 사용하고 있으며 Cocoapods를 제거하려면 다음을 수행해야 합니다.
Build PhasesEmbed Pods Frameworks
개발자가 직면할 수 있는 두 가지 측면이 있습니다.
- 프로젝트에서 포드를 완전히 제거하고 싶거나
- 개발자는 포드에서 프로젝트의 특정 프레임워크를 제거하려고 합니다.
첫 번째 경우에는 '포드 통합 해제'를 사용하고 위의 답변에 언급된 몇 가지 단계를 따라야 합니다.
두 번째 경우에는 포드 파일에서 사용할 수 있는 매우 간단한 방법으로 설치된 특정 프레임워크를 제거하려는 경우에는 제거하고 포드 설치 명령을 실행할 프레임워크에 주석을 달기만 하면 됩니다.
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
target 'ProjectName' do
# Uncomment this line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
pod 'iCarousel', '~> 1.8'
# pod 'Facebook-iOS-SDK', '~> 4.1'
# pod 'ParseFacebookUtilsV4', '~> 1.11'
# pod 'Parse', '~> 1.14'
end
여기서 나는 iCarousel이 아닌 Facebook을 제거하고 프레임워크(포드를 사용하여 설치됨)를 구문 분석하고 싶기 때문에 위와 같이 포드 파일을 업데이트했습니다.
이제 pod install을 실행하면 iCarouse를 프로젝트에 그대로 유지하고 Facebook을 제거하고 구문 분석합니다.
$ sudo gem install cocoapods-deintegrate cocoapods-clean
$ pod deintegrate
$ pod clean
$ rm Podfile
- 가장 먼저 수행해야 할 작업은 다음과 같습니다.
Podfile,Podfile.lock,Pods폴더 및 생성된 작업 영역입니다. .xcodeproj에대참제니다합거를조에 대한 합니다.Pods.xcconfig및 파및libPods.ajava.- 빌드 단계 프로젝트 탭에서 Check Pods Manifest.lock 섹션(열림), Copy Pods Resources 섹션(하단) 및 Embed Pod Resources(하단)를 삭제합니다.
- 제다한을 합니다.
Pods.framework.
이전에 사용하던 라이브러리 중 일부를 포함하는 것이 유일한 방법입니다.포드의 폴더를 프로젝트로 끌어다 놓기만 하면 됩니다(지원 파일 폴더에 넣는 것이 좋습니다).
그것은 나에게 효과가 있었다.
프로젝트에서 포드를 제거하는 방법 Xcode
프로젝트 디렉토리를 열고 스크립트 실행
$ pod deintegrate
$ pod clean
$ rm Podfile
그런 다음 .xcworkspace 확장 파일을 수동으로 제거해야 합니다.
"ProjectName.xcworkspace"
또는 스크립트로 제거
$ rm projectname.xcworkspace
작동하지 않으면 시도합니다.
프로젝트를 정리합니다.
파생 데이터가 삭제되었습니다.
여기로 합니다.
Xcode6에서 "파생 데이터 삭제"하는 방법은 무엇입니까?
하나의 포드만 제거하고 다른 포드를 설치한 상태로 유지하려면 앱 디렉터리에서 포드 파일을 열고 제거할 포드 파일을 삭제합니다.그런 다음 터미널을 사용하여 앱 디렉터리로 이동하고 다음을 입력합니다.
pod update
제거한 포드가 포드 파일에서 제거됩니다.터미널에서 제거된 것을 확인할 수 있습니다.
Analyzing dependencies
Removing FirebaseUI
Removing UICircularProgressRing
이 방법은 포드 파일의 다른 포드에 대한 업데이트도 가져옵니다.당신은 그것을 원할 수도 있고 원하지 않을 수도 있습니다.
모든 관련 포드 파일 삭제:
- xx.xc 작업 공간
- 포드 파일
- Podfile.lock
및 Project Navigator에서 다음 작업을 수행합니다.
프로젝트 이름(파란색 아이콘) 클릭 --> 대상(*) --> 빌드 단계 --> "[CP] Check Pods manifests.lock" 제거("x" 클릭)
(*) 프로젝트 이름을 클릭하면 "프로젝트 및 대상 목록 표시"를 클릭해야 사이드바를 먼저 볼 수 있습니다.
제공된 모든 답변은 유효하고 정확합니다.그러나 cocoapod 구성이 포함된 필드 중 하나를 포드 설치 및 수정하면 치료 및 통합 작업이 예상대로 중지됩니다.
제 경우에는 빌드 설정에서 FREATE_SEARCH_PATH를 덮어썼는데 40개의 대상을 처리하면 지루해집니다...
다음 루비 파일은 프로젝트를 "완전하게" 정리하기 위해 cocoapods 명령을 실행하고 빌드 설정과 같은 추가 정리를 수행하며 프로젝트에서 "Pod" 폴더를 제거합니다.스크립트에 "정리" 또는 "통합 해제"에 의해 수행된 작업이 포함될 수도 있습니다.
require 'xcodeproj'
### HELPERS ###
# Array extension for non-Ruby rail
class Array
# Wraps and object into an array
#
# @param object [Any] The object to be wrapped
# @return [Any] The array with the value wrapped. If the object is nil, then returns empty array
def self.wrap(object)
if object.nil?
[]
elsif object.respond_to?(:to_ary)
object.to_ary || [object]
else
[object]
end
end
end
# Performs the cocoapods clean up actions. It will install the dependencies needed.
def cocoapod_clean_actions
## DEINTEGRATE
puts "** Installing Cocoapods 'DEINTEGRATE' **"
system("sudo gem install cocoapods-deintegrate")
puts "** Performing Cocoapods 'DEINTEGRATE' **"
system("pod deintegrate")
## CLEAN
puts "** Installing Cocoapods 'CLEAN' **"
system("sudo gem install cocoapods-deintegrate")
puts "** Performing Cocoapods 'CLEAN' **"
system("pod clean")
end
# Performs a clean up on the build settings removing all the identified pods leftovers
#
# @param project [Xcodeproj] Xcode project where to permorm the actions
def clean_build_settings(project)
puts "** Removing Cocoapods references from 'BUILD SETTING' **"
podsOcurrence = "PODS"
project.targets.each { |target|
target.build_configurations.each { |build_configuration|
puts "Inspecting BUILD_SETTINGS for TARGET => #{target.name} & CONFIGURATION => #{build_configuration.name}"
build_settings = build_configuration.build_settings
build_settings.each { |key, value|
if key.include?(podsOcurrence)
build_settings.delete(key)
else
clean(build_settings, key, podsOcurrence)
end
}
}
}
project.save()
end
# Performs a clean-up on a specific key of the build settings by removing the occurrences given. It also cleans the value if empty.
#
# @param build_settings [Hash] Build Settings for a specific target and configuration
# @param flag [String] Key to find in the build_settings
# @param occurence [String] The occurence to be removed from the value of build settings key
def clean(build_settings, flag, occurence)
puts "CLEAN => flag = #{flag}, ocurrence = #{occurence}"
indexes = Array.new()
build_settings_flag = Array.wrap(build_settings[flag])
build_settings_flag.each_with_index { |value, index|
if value.include?(occurence)
previous_index = index - 1
if previous_index >= 0 && build_settings_flag[previous_index].to_s&.start_with?("-")
indexes.append(previous_index)
end
indexes.append(index)
end
}
if indexes.count > 0
build_settings_flag.delete_if.with_index { |_, index|
indexes.include? index
}
# Replace the value for the build setting
if build_settings_flag.empty?
puts "Removing empty array #{flag}"
build_settings.delete(flag)
else
puts "Reassining array #{flag}"
build_settings[flag] = build_settings_flag
end
end
end
# Performs a clean up on the build settings removing all the identified pods leftovers
#
# @param project [Xcodeproj] Xcode project where to permorm the actions
def clean_build_phases(project)
puts "** Removing Cocoapods references from 'BUILD_PHASES' **"
project.targets.each { |target|
#if target.name == "WhiteLabel" #TESTING
puts "Inspecting BUILD_PHASES for TARGET => #{target.name}"
target.shell_script_build_phases.each { |shell_script|
if shell_script.name.include?("[CP]")
puts "Removing '#{shell_script.name}' shell script"
shell_script.remove_from_project()
elsif shell_script.name == "Crashlytics Run Script"
puts "Deleting '#{shell_script.name}'"
# Add extra build phases such as the Crashlytics
#shell_script.remove_from_project()
end
}
#break #TESTING
#end #TESTING
}
project.save()
end
# Removes all the unwanted cocoapods files and folders from the project
#
# @param project [Xcodeproj] Xcode project where to permorm the actions
def remove_files_and_folders(project)
puts "** Removing Cocoapods files and folders from project **"
## Project
# BE CAREFUL WITH GROUP(LINK) NAME AND GROUP PATH(FOLDER)
project.groups.find{ |group| group.path == "Pods" }&.remove_from_project()
project.save()
# File system
system('rm -rf Pods')
#system('rm Podfile')
end
### MAIN ###
puts "********** Cocoapods CLEAN UP **********"
cocoapod_clean_actions()
puts "********** Cocoapods EXTRA CLEAN UP **********"
project = Xcodeproj::Project.open "./WhiteLabel.xcodeproj"
clean_build_settings(project)
clean_build_phases(project)
remove_files_and_folders(project)
project.save()
그리고 그것은 부를 수 있습니다.
ruby PodExtraClean.rb
iv가 한 일을 매우 간략하게 작성할 것입니다(내 프로젝트에서 코코아 포드를 삭제하기 위해).
- 추가된 폴더 삭제(프레임워크, 포드 등)
- 추가된 파일(PROJECT.xcworkspace, PodFile, PodFile.lock, Pod-PROJECT.debug.xccconfig, Pods-PROJECT.release)을 삭제합니다.xccconfig, ...)
- 원래의 것(프로젝트, 프로젝트_테스트, 프로젝트.xcodeproj)만 남겨둡니다.
- xcode의 프로젝트에서 프레임워크 참조 제거
xcode에서 프레임워크 참조를 제거하려면:
- 프로젝트 탐색기 사용
- 프로젝트 선택
- 대상 프로젝트 선택
- 상단 옵션에서 빌드 단계 선택
- 기본 그룹(대상 종속성, 소스 컴파일, 라이브러리와 연결된 이진, 번들 리소스 복사)은 그대로 두고 다른 그룹은 삭제
더 이상 타락할 필요는 없다고 생각합니다.터미널에서 다음 명령을 사용하여 이 작업을 수행할 수 있었습니다.
포드 설치
그리고 더 이상 포드 파일에 없는 것들을 자동으로 제거했습니다.
다음 터미널의 명령을 사용합니다(새 줄의 시작 부분에 sudo를 사용하는 것을 잊지 마십시오).
open:YourDir YouName$ sudo gem uninstall cocoapods
Password:?
Remove executables:
pod, sandbox-pod
in addition to the gem? [Yn] Y
Removing pod
Removing sandbox-pod
Successfully uninstalled cocoapods-1.4.0
open:YourDir YourName$ gem list --local | grep cocoapods
cocoapods-core (1.4.0)
cocoapods-deintegrate (1.0.2)
cocoapods-downloader (1.1.3)
cocoapods-plugins (1.0.0)
cocoapods-search (1.0.0)
cocoapods-stats (1.0.0)
cocoapods-trunk (1.3.0)
cocoapods-try (1.1.0)
다음과 같이 목록을 하나씩 제거합니다.
open:YourDir YourName$ sudo gem uninstall cocoapods-core
Successfully uninstalled cocoapods-core-1.4.0
open:YourDir YourName$ sudo gem uninstall cocoapods-trunk
Successfully uninstalled cocoapods-trunk-1.3.0
open:YourDir YourName$ sudo gem uninstall cocoapods-try
Successfully uninstalled cocoapods-try-1.1.0
open:YourDir YourName$ gem list --local | grep cocoapods
open:YourDir YourName$ sudo gem uninstall cocoapods-stats
Successfully uninstalled cocoapods-stats-1.0.0
open:YourDir YourName$ sudo gem uninstall cocoapods-search
Successfully uninstalled cocoapods-search-1.0.0
open:YourDir YourName$ sudo gem uninstall cocoapods-downloader
Successfully uninstalled cocoapods-downloader-1.1.3
open:YourDir YourName$ sudo gem uninstall cocoapods-plugins
Successfully uninstalled cocoapods-plugins-1.0.0
open:YourDir YourName$ gem list --local | grep cocoapods
cocoapods-deintegrate (1.0.2)
open:YourDir YourName$ sudo gem uninstall cocoapods-deintegrate
Successfully uninstalled cocoapods-deintegrate-1.0.2
open:YourDir YourName$ sudo gem uninstall cocoapods-stats
Successfully uninstalled cocoapods-stats-1.0.0
open:YourDir YourName$ sudo gem uninstall cocoapods-search
Successfully uninstalled cocoapods-search-1.0.0
open:YourDir YourName$ sudo gem uninstall cocoapods-downloader
Successfully uninstalled cocoapods-downloader-1.1.3
open:YourDir YourName$ sudo gem uninstall cocoapods-plugins
Successfully uninstalled cocoapods-plugins-1.0.0
open:YourDir YourName$ gem list --local | grep cocoapods
cocoapods-deintegrate (1.0.2)
open:YourDir YourName$ sudo gem uninstall cocoapods-deintegrate
Successfully uninstalled cocoapods-deintegrate-1.0.2
코코아팟 앱(버전 1.5.2)을 사용하여 프로젝트에서 포드를 제거할 수 있었습니다.이후 폴더에서 podfile, podfile.lock, xcworkspace 파일만 삭제했습니다.
상세한 그림 표현
다음 명령은 특정 요소를 삭제하는 데 사용되며 설치가 다시 시작됩니다.
`$ pod deintegrate
$ pod cache clean --all
$ pod install`
언급URL : https://stackoverflow.com/questions/16427421/how-to-remove-cocoapods-from-a-project
'programing' 카테고리의 다른 글
| 읽기 전용 속성에서는 양방향 또는 단방향 ToSource 바인딩이 작동할 수 없습니다. (0) | 2023.04.29 |
|---|---|
| 푸시되지 않은 GIT 커밋을 삭제하려면 어떻게 해야 합니까? (0) | 2023.04.29 |
| ASP에서 가장 좋은 방법은 무엇입니까?현재 도메인을 얻기 위한 NET? (0) | 2023.04.29 |
| WPF에서 문화를 설정하고 변경하는 방법 (0) | 2023.04.29 |
| arc4random_uniform()의 범위 사이에 난수를 어떻게 만들 수 있습니까? (0) | 2023.04.29 |



