[已解決] Xcode3.0不能移除(已爬文) - iPhone4.TW
本站已於 2026 年 5 月轉為靜態存檔  ·  內容凍結,無法登入、發文、回覆、搜尋  ·  想看吉米最新內容? 前往 jimmy4.tw →


第1頁,共2頁 12 最後最後
顯示結果從 1 到 10 共計 12 條
  1. #1

    愛用者

    註冊日期:02-25-2008
    文章:41
    謝謝你: 4
    在 0篇文章中獲得 0個感謝
    在還是Leopard的時候裝了Xcode3.0,今天升級至Snow Leopard後想裝Xcode4來用,

    爬文後知道要先移除Xcode3,於是我按照網路上的說明,至終端機輸入:
    「sudo /Developer/Library/uninstall-devtools --mode=all」
    然後也照要求輸入密碼,
    但卻出現以下訊息:

    「ERROR: Can't locate uninstaller script /Library/Developer/3.0/uninstall-devtools」

    直接去找/Developer/Library/uninstall-devtools
    點擊後卻是出現這個「ERROR: Must be run with root permissions -- prefix command with 'sudo'.」

    p.s.我是用管理者的帳號在操作的

    請問有人有遇過這個問題嗎?能告知解決方法嗎?
    感激不盡!


    已解決:
    很感謝皮樂姊還有relaxHuang(無敵大好人!!!)

    relaxHuang不但通過e-mail替我看script,還仔細的告訴我如何修改,讓電腦**如我也順利解決問題!

    以下貼出
    relaxHuang幫我找到的解決辦法。

    1. 找這兩個檔案出來:
    /Library/Developer/3.0/uninstall-devtools
    /Developer/Library/uninstall-developer-folder

    2. 分別使用文字編輯打開它們,找到以下的程式碼:

    sub get_system_version {
    my $system_version = `sw_vers -productVersion`;
    chomp($system_version);
    if ($system_version =~ /^10\.4/) {
    $system_version = '10.4';
    } elsif ($system_version =~ /^10.5/) {
    $system_version = '10.5';
    } else {
    die("Can't determine system version.\n");
    }


    print_debug("system_version=$system_version\n");


    return $system_version;
    }

    然後將這行註解起來


    「die("Can't determine system version.\n");」


    變成


    「#die("Can't determine system version.\n");」


    並且換行(按 Enter 後)


    加上以下這行


    「$system_version = '10.5';」

    儲存之後(建議原始檔案先備份)

    去終端機執行:sudo /Library/Developer/3.0/uninstall-devtools

    然後再執行:
    sudo /Developer/Library/uninstall-devtools --mode=all


    大功告成!


    再次感謝
    relaxHuang!!!
    此篇文章於 01-05-2012 23:24 被 felixhaua 編輯。 原因: 已解決


  2. #2
    Hiraku 的頭像

    皮樂

    註冊日期:06-12-2008
    文章:13,851
    謝謝你: 561
    在 1,027篇文章中獲得 5,832個感謝
    重新安裝Xcode 3.x再移除看看?



  3. #3

    愛用者

    註冊日期:02-25-2008
    文章:41
    謝謝你: 4
    在 0篇文章中獲得 0個感謝
    謝謝皮樂姊的回應,
    重新安裝3.0之後,
    去終端機,出現這個
    「Can't determine system version.
    Can't determine system version.
    Can't determine system version.」

    去找/Developer/Library/uninstall-devtools
    點擊後還是出現這個「ERROR: Must be run with root permissions -- prefix command with 'sudo'.」

    囧rz...


  4. #4

    愛用者

    註冊日期:02-25-2008
    文章:41
    謝謝你: 4
    在 0篇文章中獲得 0個感謝
    唔...剛剛孤狗到解決方案如下:

    Solution
    This thread about Uninstalling XCode 3.0 in Snow Leopard helped. In summary:

    Edit the script "/Library/Developer/3.0/uninstall-devtools". Using the # symbol, comment out the lines that check for system version. Or better yet, change "if" clause (that queries the system version) from "if it's system 10.5" to "if it's system 10.6" and leave the "then" clause (that sets the system version inside the script) as-is. Thus, you'll have: if 10.6 -> then 10.5. Then run:

    sudo /Library/Developer/3.0/uninstall-devtools
    Rinse and repeat inside the /Library/Developer/Shared/uninstall-devtools script.

    Then re-run:

    sudo /Developer/Library/uninstall-devtools --mode=all
    Finally, drag the folder /Developer to the trash and take out that trash! Reboot.


    但老實說...看不是很懂...單字都不是很難,但拼在一起就是看不懂,可能是我沒有程式的底子(?)。
    尤其是「Edit the script "/Library/Developer/3.0/uninstall-devtools". Using the # symbol, comment out the lines that check for system version. Or better yet, change "if" clause (that queries the system version) from "if it's system 10.5" to "if it's system 10.6" and leave the "then" clause (that sets the system version inside the script) as-is. Thus, you'll have: if 10.6 -> then 10.5.」這段。

    有好心人可以解救我脫離水深火熱(?)之中嗎?


  5. #5
    Hiraku 的頭像

    皮樂

    註冊日期:06-12-2008
    文章:13,851
    謝謝你: 561
    在 1,027篇文章中獲得 5,832個感謝
    終端機輸入 sudo /Developer/Library/uninstall-devtools 看看?

    他的教學是要叫你修改uninstall-devtools這個指令,不過我的是4.2的,所以教學說的部分我找不到在哪裡



  6. #6

    愛用者

    註冊日期:02-25-2008
    文章:41
    謝謝你: 4
    在 0篇文章中獲得 0個感謝
    唔,謝謝皮樂姊,

    但我就是輸入「sudo /Developer/Library/uninstall-devtools」以後才出現
    「Can't determine system version.
    Can't determine system version.
    Can't determine system version.」的

    難道我的程式開發之夢還沒開始就要破碎了嗎(抱頭)


  7. #7
    relaxHuang 的頭像

    超熱血的愛用者

    註冊日期:05-09-2009
    文章:654
    謝謝你: 2
    在 22篇文章中獲得 30個感謝
    有試過不要移除,直接安裝 Xcode 4 嗎?

    因為 Xcode 4 的路徑跟之前不太一樣,印象中安裝是不會衝突啦 (只是會有點啞**ˊ @@)

    不過可以試試看,否則最簡單的方法就是直接弄個乾淨的環境來安裝吧!反正 SL 的 Xcode 是透過 App Store 來安裝的,還蠻方便啦

    =======
    喔對,現在上面的 Xcode 好像只剩下 Lion 版了 XD...
    此篇文章於 01-04-2012 11:17 被 relaxHuang 編輯。



  8. #8

    愛用者

    註冊日期:02-25-2008
    文章:41
    謝謝你: 4
    在 0篇文章中獲得 0個感謝
    嗯,謝謝,因為這台電腦不新了,加上我之前上網看好像會有共用資料的部份。要是以後真的必須刪除3.0的東西,可能一不小心會刪到4的,變成都不能用(汗)。然後現在App Store的Xcode要Lion才能裝Orz

    我把uninstall-devtools的script用文字編輯打開是這樣:


    #!/usr/bin/perl -w
    ####################################################################################################
    #
    # Copyright (c) 2002-2007 Apple, Inc
    #
    # NAME
    # uninstall-devtools -- Meta-script for running the various devtools uninstaller scripts.
    #
    # SYNOPSIS
    # sudo /Developer/Library/uninstall-devtools --mode=all
    # sudo /Developer/Library/uninstall-devtools --mode=xcodedir
    # sudo /Developer/Library/uninstall-devtools --mode=unixdev
    # sudo /Developer/Library/uninstall-devtools --mode=systemsupport
    #
    # Where the specified 'mode' value invokes the following devtools uninstaller scripts:
    #
    # all:
    # /Library/Developer/Shared/uninstall-devtools
    # /Library/Developer/3.0/uninstall-devtools
    # /Developer/Library/uninstall-developer-folder
    #
    # xcodedir:
    # /Developer/Library/uninstall-developer-folder
    #
    # unixdev:
    # /Library/Developer/Shared/uninstall-devtools
    #
    # systemsupport:
    # /Library/Developer/Shared/uninstall-devtools
    # /Library/Developer/3.0/uninstall-devtools
    #
    # The default value for 'mode' is 'all'.
    #
    # DESCRIPTION
    # This command runs the appropriate devtools uninstaller scripts according to the usage
    # specified on the command line.
    ####################################################################################################

    use strict;
    use warnings;

    use File::Basename;
    use Getopt::Long;
    use FindBin qw($Bin);

    ####################################################################################################

    my $do_nothing = 0;
    my $verbose = 0;
    my $warning = 0;
    my $debug = 0;
    my $help = 0;
    my $mode = '';

    GetOptions(
    'do-nothing' => \$do_nothing,
    'verbose' => \$verbose,
    'warning' => \$warning,
    'debug' => \$debug,
    'help' => \$help,
    'mode:s' => \$mode,
    );

    ####################################################################################################

    if ($help == 1) {
    print("Usage: $0 --mode=<all|xcodedir|unixdev|systemsupport>\n");
    print <<"END";
    This is a meta-script which invokes one or more of the devtools
    uninstaller scripts, depending on which mode you select.

    The recognized modes are:
    all:
    /Library/Developer/Shared/uninstall-devtools
    /Library/Developer/3.0/uninstall-devtools
    /Developer/Library/uninstall-developer-folder

    xcodedir:
    /Developer/Library/uninstall-developer-folder

    unixdev:
    /Library/Developer/Shared/uninstall-devtools

    systemsupport:
    /Library/Developer/Shared/uninstall-devtools
    /Library/Developer/3.0/uninstall-devtools

    The default value for 'mode' is 'all'.
    END
    exit(0);
    }

    ####################################################################################################
    # Determine if we are authorized to uninstall the devtools packages.
    ####################################################################################################

    $| = 1;
    if (($do_nothing == 0) && ($< != 0)) {
    die("ERROR: Must be run with root permissions -- prefix command with 'sudo'.\n");
    }

    ####################################################################################################

    my $uninstaller_dir = $Bin;
    my $uninstaller_dir_basename = basename($uninstaller_dir);
    my $developer_dir = dirname($uninstaller_dir);

    ####################################################################################################

    my $flags = '';
    if ($do_nothing == 1) {
    $flags .= '--do-nothing ';
    }
    if ($verbose == 1) {
    $flags .= '--verbose ';
    }
    if ($warning == 1) {
    $flags .= '--warning ';
    }
    if ($debug == 1) {
    $flags .= '--debug ';
    }

    if (($mode eq '') || ($mode eq 'all')) {
    run_uninstaller_script("/Library/Developer/3.0/uninstall-devtools",$flags);
    run_uninstaller_script("/Library/Developer/Shared/uninstall-devtools",$flags);
    run_uninstaller_script("$developer_dir/Library/uninstall-developer-folder",$flags);
    } elsif ($mode eq 'xcodedir') {
    run_uninstaller_script("$developer_dir/Library/uninstall-developer-folder",$flags);
    } elsif ($mode eq 'unixdev') {
    run_uninstaller_script("/Library/Developer/Shared/uninstall-devtools",$flags);
    } elsif ($mode eq 'systemsupport') {
    run_uninstaller_script("/Library/Developer/3.0/uninstall-devtools",$flags);
    run_uninstaller_script("/Library/Developer/Shared/uninstall-devtools",$flags);
    } else {
    die("Usage: $0 --mode=<all|xcodedir|shared|systemsupport>\n");
    }

    ####################################################################################################

    sub run_uninstaller_script {
    my $script = shift;
    my $flags = shift;

    if (! -x $script) {
    print("ERROR: Can't locate uninstaller script $script\n");
    } else {
    system("$script $flags");
    }
    }

    ####################################################################################################


    但我不知道他說關於系統版本的東西在哪邊...也不知道該如何改QQ
    謝謝。


  9. #9
    relaxHuang 的頭像

    超熱血的愛用者

    註冊日期:05-09-2009
    文章:654
    謝謝你: 2
    在 22篇文章中獲得 30個感謝

  10. #10

    愛用者

    註冊日期:02-25-2008
    文章:41
    謝謝你: 4
    在 0篇文章中獲得 0個感謝
    謝謝,您貼的那個我昨天就有看到,並且已經有把內容貼在上面的回覆中了@@

    現在的問題是我不知道如何修改script...


 

 

相似的主題

  1. [求助] iPhone4.TW在地優化套件,移除時發生錯誤,(已爬文)
    由shaunLin論壇中iPhone 疑難雜症發問區
    回覆: 7
    最後發表: 07-04-2013, 17:36
  2. [求助] Iphone4 電池待機過短問題(已爬文)
    由chsaryichen論壇中iPhone 疑難雜症發問區
    回覆: 12
    最後發表: 11-29-2010, 01:22
  3. [求助] iphone4錄影時要擺橫向還是直向?(已爬文)
    由p12076論壇中iPhone 疑難雜症發問區
    回覆: 0
    最後發表: 11-01-2010, 14:18
  4. [求助] iPhone 3GS既有檔案傳電腦(已爬文)
    由ReneeLing論壇中iPhone 疑難雜症發問區
    回覆: 4
    最後發表: 09-20-2009, 23:01
  5. 新手越獄的幾個小問題(已爬文)
    由jimmyjian論壇中iPhone 疑難雜症發問區
    回覆: 6
    最後發表: 11-01-2008, 02:39

發文規則

  • 不可以發表新主題
  • 不可以發表回覆
  • 不可以上傳附件
  • 不可以編輯自己的文章
  •  
回到此頁頂端