Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 6 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,15 @@
### 配置 theos

```
sudo git clone --recursive https://github.com/theos/theos.git /opt/theos
```

打开 `~/.bash_profile`,末尾加入

```
export THEOS=/opt/theos
export PATH=/opt/theos/bin/:$PATH
```

刷新生效

```
source ~/.bash_profile
bash -c "$(curl -fsSL https://raw.githubusercontent.com/theos/theos/master/bin/install-theos)"
```

遇到问题,请参考 [theos](https://github.com/theos/theos/wiki/Installation) 安装文档。

### 配置 EasyDev

```
sudo git clone --recursive https://github.com/lemon4ex/EasyDev.git /opt/EasyDev
git clone --recursive https://github.com/lemon4ex/EasyDev.git ~/EasyDev
```

### 配置 ldid
Expand All @@ -51,13 +38,13 @@ sudo git clone --recursive https://github.com/lemon4ex/EasyDev.git /opt/EasyDev
brew install ldid
```

`/opt/EasyDev/bin`目录内已自带,也可不安装。
`~/EasyDev/bin`目录内已自带,也可不安装。

### 配置免密码登录越狱设备

```
ssh-keygen -t rsa -P ''
ssh-copy-id -i /Users/username/.ssh/id_rsa root@ip
ssh-copy-id -i ~/.ssh/id_rsa root@ip
```

如果没有越狱设备,可跳过。
Expand All @@ -79,14 +66,14 @@ xcode-select -p
执行安装命令:

```
cd /opt/EasyDev/bin
cd ~/EasyDev/bin
chmod +x ed-install
./ed-install
```

### 卸载
```
cd /opt/EasyDev/bin
cd ~/EasyDev/bin
chmod +x ed-uninstall
./ed-uninstall
```
Expand Down
2 changes: 1 addition & 1 deletion bin/createIPA.command
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

if [[ ${DIR} = "/opt/EasyDev/bin" ]]; then
if [[ ${DIR} = "~/EasyDev/bin" ]]; then
DIR="$PWD"
fi

Expand Down
11 changes: 6 additions & 5 deletions bin/ed
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,25 @@
export setCmd="set -eo pipefail"
$setCmd

export PATH=/opt/EasyDev/bin:$EasyDevTheosPath/bin:/usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin:$PATH
export userName="${SUDO_USER-$USER}"
export userGroup=`id -g $userName`
export userHome=`eval echo ~$userName`

export PATH=$userHome/EasyDev/bin:$EasyDevTheosPath/bin:/usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin:$PATH

export scriptName="${0##*/}"
export scriptVer="2.0"
export originalArguments=("$@")
export activeActionArg

export EasyDevPath="/opt/EasyDev"
export EasyDevPath="$userHome/EasyDev"
#默认设备ip
export DefaultDeviceIP="localhost"
#默认端口号
export DefaultDevicePort="2222"

export DefaultDeviceBuildsDir="/var/root/EasyDevBuilds"

export userName="${SUDO_USER-$USER}"
export userGroup=`id -g $userName`
export userHome=`eval echo ~$userName`
export bashProfileFiles=("$userHome/.zshrc" "$userHome/.bash_profile" "$userHome/.bashrc" "$userHome/.bash_login" "$userHome/.profile")

export tempDirsFile="`mktemp -d -t $scriptName`/tempdirs"
Expand Down
24 changes: 16 additions & 8 deletions bin/ed-install
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@
export setCmd="set -eo pipefail"
$setCmd

#获取用户名、用户组、用户目录、和profile文件
export userName="${SUDO_USER-$USER}"
export userGroup=$(id -g $userName)
export userHome=$(eval echo ~$userName)

#导出环境变量
export PATH=/opt/EasyDev/bin:/usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin:$PATH
export PATH=$userHome/EasyDev/bin:/usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin:$PATH

#脚本名称和版本
export scriptName="${0##*/}"
export scriptVer="2.0"

#本地存储文件的目录
export EasyDevPath="/opt/EasyDev"
export EasyDevPath="$userHome/EasyDev"
export backupFileExt=".EasyDev"

#获取用户名、用户组、用户目录、和profile文件
export userName="${SUDO_USER-$USER}"
export userGroup=$(id -g $userName)
export userHome=$(eval echo ~$userName)

#用户可能存在的profile文件
export bashProfileFiles=("$userHome/.zshrc" "$userHome/.bash_profile" "$userHome/.bashrc" "$userHome/.bash_login" "$userHome/.profile")

Expand Down Expand Up @@ -286,14 +286,22 @@ function versionGe() {
}

# start it
# 创建/opt/EasyDev
# 创建~/EasyDev
mkdir -p "$EasyDevPath" ||
panic $? "Failed to make directory: $EasyDevPath"

#下载一些基础文件和模板文件
# downloadGithubTarball "https://codeload.github.com/AloneMonkey/EasyDev/tar.gz/master" "$EasyDevPath" "EasyDev base"
# downloadGithubTarball "https://codeload.github.com/AloneMonkey/EasyDev-Xcode-Templates/tar.gz/master" "$EasyDevPath/templates" "Xcode templates"

#替换模板环境变量
echo "Replace template environment variables..."

find $EasyDevPath/templates -name "TemplateInfo.plist" | while read -r file; do
sed -i '' -e "s|\${EasyDevPath}|${EasyDevPath}|g" "$file"
sed -i '' -e "s|\${THEOS}|${THEOS}|g" "$file"
done

#创建符号链接
echo "Creating symlink to Xcode templates..."

Expand Down
11 changes: 6 additions & 5 deletions bin/ed-uninstall
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@
export setCmd="set -eo pipefail"
$setCmd

export PATH=/opt/EasyDev/bin:/usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin:$PATH
export userName="${SUDO_USER-$USER}"
export userGroup=`id -g $userName`
export userHome=`eval echo ~$userName`

export PATH=$userHome/EasyDev/bin:/usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin:$PATH

export scriptName="${0##*/}"
export scriptVer="2.0"

export EasyDevPath="/opt/EasyDev"
export EasyDevPath="$userHome/EasyDev"
export backupFileExt=".EasyDev"

export userName="${SUDO_USER-$USER}"
export userGroup=`id -g $userName`
export userHome=`eval echo ~$userName`
export bashProfileFiles=("$userHome/.zshrc" "$userHome/.bash_profile" "$userHome/.bashrc" "$userHome/.bash_login" "$userHome/.profile")

export tempDirsFile="`mktemp -d -t $scriptName`/tempdirs"
Expand Down
6 changes: 3 additions & 3 deletions templates/Base.xctemplate/TemplateInfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<key>ENABLE_BITCODE</key>
<string>NO</string>
<key>EasyDevTheosPath</key>
<string>/opt/theos</string>
<string>${THEOS}</string>
<key>TARGETED_DEVICE_FAMILY</key>
<string>1,2</string>
<key>GCC_WARN_UNDECLARED_SELECTOR</key>
Expand All @@ -81,7 +81,7 @@
<key>LIBRARY_SEARCH_PATHS</key>
<string>$(inherited) $(EasyDevPath)/lib $(EasyDevTheosPath)/lib $(EasyDevTheosPath)/vendor/lib</string>
<key>EasyDevPath</key>
<string>/opt/EasyDev</string>
<string>${EasyDevPath}</string>
<key>IPHONEOS_DEPLOYMENT_TARGET</key>
<string>8.0</string>
<key>FRAMEWORK_SEARCH_PATHS</key>
Expand Down Expand Up @@ -173,7 +173,7 @@
<key>Definitions</key>
<dict>
<key>*:*:importTheosPrefix</key>
<string>#import &quot;/opt/theos/Prefix.pch&quot; //path/to/theos/Prefix.pch</string>
<string>#import &quot;${THEOS}/Prefix.pch&quot; //path/to/theos/Prefix.pch</string>
<key>*:comments</key>
<string>//
// ___FILENAME___
Expand Down
2 changes: 1 addition & 1 deletion templates/CaptainHook Tweak.xctemplate/TemplateInfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
</dict>
<dict>
<key>ShellScript</key>
<string>/opt/EasyDev/bin/ed --xcbp</string>
<string>${EasyDevPath}/bin/ed --xcbp</string>
<key>ShellPath</key>
<string>/bin/sh</string>
<key>RunOnlyForDeploymentPostprocessing</key>
Expand Down
4 changes: 2 additions & 2 deletions templates/Cocoa App Plugin.xctemplate/TemplateInfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
<key>ShellPath</key>
<string>/bin/sh</string>
<key>ShellScript</key>
<string>/opt/EasyDev/tools/pack-osx.sh</string>
<string>${EasyDevPath}/tools/pack-osx.sh</string>
</dict>
<dict>
<key>Class</key>
Expand All @@ -126,7 +126,7 @@
<key>ShellPath</key>
<string>/bin/sh</string>
<key>ShellScript</key>
<string>/opt/EasyDev/tools/pack-osx.sh codesign</string>
<string>${EasyDevPath}/tools/pack-osx.sh codesign</string>
</dict>
</array>
<key>TargetIdentifier</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<key>ENABLE_BITCODE</key>
<string>NO</string>
<key>EasyDevTheosPath</key>
<string>/opt/theos</string>
<string>${THEOS}</string>
<key>GCC_WARN_UNDECLARED_SELECTOR</key>
<string>NO</string>
<key>GCC_WARN_ABOUT_MISSING_PROTOTYPES</key>
Expand All @@ -55,7 +55,7 @@
<key>LIBRARY_SEARCH_PATHS</key>
<string>$(inherited) $(EasyDevPath)/lib $(EasyDevTheosPath)/lib $(EasyDevTheosPath)/vendor/lib</string>
<key>EasyDevPath</key>
<string>/opt/EasyDev</string>
<string>${EasyDevPath}</string>
<key>MACOSX_DEPLOYMENT_TARGET</key>
<string>10.9</string>
<key>FRAMEWORK_SEARCH_PATHS</key>
Expand All @@ -77,7 +77,7 @@
</dict>
<dict>
<key>ShellScript</key>
<string>/opt/EasyDev/bin/ed --xcbp</string>
<string>${EasyDevPath}/bin/ed --xcbp</string>
<key>ShellPath</key>
<string>/bin/sh</string>
<key>RunOnlyForDeploymentPostprocessing</key>
Expand Down
8 changes: 4 additions & 4 deletions templates/Cocoa Logos Tweak.xctemplate/TemplateInfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<key>ENABLE_BITCODE</key>
<string>NO</string>
<key>EasyDevTheosPath</key>
<string>/opt/theos</string>
<string>${THEOS}</string>
<key>GCC_WARN_UNDECLARED_SELECTOR</key>
<string>NO</string>
<key>GCC_WARN_ABOUT_MISSING_PROTOTYPES</key>
Expand All @@ -55,7 +55,7 @@
<key>LIBRARY_SEARCH_PATHS</key>
<string>$(inherited) $(EasyDevPath)/lib $(EasyDevTheosPath)/lib $(EasyDevTheosPath)/vendor/lib</string>
<key>EasyDevPath</key>
<string>/opt/EasyDev</string>
<string>${EasyDevPath}</string>
<key>MACOSX_DEPLOYMENT_TARGET</key>
<string>10.9</string>
<key>FRAMEWORK_SEARCH_PATHS</key>
Expand All @@ -65,7 +65,7 @@
<array>
<dict>
<key>ShellScript</key>
<string>/opt/EasyDev/bin/ed --xcbp-logos</string>
<string>${EasyDevPath}/bin/ed --xcbp-logos</string>
<key>ShellPath</key>
<string>/bin/sh</string>
<key>RunOnlyForDeploymentPostprocessing</key>
Expand All @@ -87,7 +87,7 @@
</dict>
<dict>
<key>ShellScript</key>
<string>/opt/EasyDev/bin/ed --xcbp</string>
<string>${EasyDevPath}/bin/ed --xcbp</string>
<key>ShellPath</key>
<string>/bin/sh</string>
<key>RunOnlyForDeploymentPostprocessing</key>
Expand Down
6 changes: 3 additions & 3 deletions templates/Cocoa Touch Library.xctemplate/TemplateInfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
<key>GCC_PRECOMPILE_PREFIX_HEADER</key>
<string>YES</string>
<key>EasyDevPath</key>
<string>/opt/EasyDev</string>
<string>${EasyDevPath}</string>
<key>EasyDevTheosPath</key>
<string>/opt/theos</string>
<string>${THEOS}</string>
</dict>
<key>BuildPhases</key>
<array>
Expand All @@ -47,7 +47,7 @@
</dict>
<dict>
<key>ShellScript</key>
<string>/opt/EasyDev/bin/ed --xcbp</string>
<string>${EasyDevPath}/bin/ed --xcbp</string>
<key>ShellPath</key>
<string>/bin/sh</string>
<key>RunOnlyForDeploymentPostprocessing</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
</dict>
<dict>
<key>ShellScript</key>
<string>/opt/EasyDev/bin/ed --xcbp</string>
<string>${EasyDevPath}/bin/ed --xcbp</string>
<key>ShellPath</key>
<string>/bin/sh</string>
<key>RunOnlyForDeploymentPostprocessing</key>
Expand Down
4 changes: 2 additions & 2 deletions templates/Logos Tweak.xctemplate/TemplateInfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<array>
<dict>
<key>ShellScript</key>
<string>/opt/EasyDev/bin/ed --xcbp-logos</string>
<string>${EasyDevPath}/bin/ed --xcbp-logos</string>
<key>ShellPath</key>
<string>/bin/sh</string>
<key>RunOnlyForDeploymentPostprocessing</key>
Expand All @@ -61,7 +61,7 @@
</dict>
<dict>
<key>ShellScript</key>
<string>/opt/EasyDev/bin/ed --xcbp</string>
<string>${EasyDevPath}/bin/ed --xcbp</string>
<key>ShellPath</key>
<string>/bin/sh</string>
<key>RunOnlyForDeploymentPostprocessing</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
</dict>
<dict>
<key>ShellScript</key>
<string>/opt/EasyDev/bin/ed --xcbp</string>
<string>${EasyDevPath}/bin/ed --xcbp</string>
<key>ShellPath</key>
<string>/bin/sh</string>
<key>RunOnlyForDeploymentPostprocessing</key>
Expand Down
2 changes: 1 addition & 1 deletion templates/XPC Service.xctemplate/TemplateInfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
</dict>
<dict>
<key>ShellScript</key>
<string>/opt/EasyDev/bin/ed --xcbp</string>
<string>${EasyDevPath}/bin/ed --xcbp</string>
<key>ShellPath</key>
<string>/bin/sh</string>
<key>RunOnlyForDeploymentPostprocessing</key>
Expand Down
4 changes: 2 additions & 2 deletions templates/iOS App Plugin.xctemplate/TemplateInfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
<key>ShellPath</key>
<string>/bin/sh</string>
<key>ShellScript</key>
<string>/opt/EasyDev/tools/pack-ios.sh</string>
<string>${EasyDevPath}/tools/pack-ios.sh</string>
</dict>
<dict>
<key>Class</key>
Expand All @@ -126,7 +126,7 @@
<key>ShellPath</key>
<string>/bin/sh</string>
<key>ShellScript</key>
<string>/opt/EasyDev/tools/pack-ios.sh codesign</string>
<string>${EasyDevPath}/tools/pack-ios.sh codesign</string>
</dict>
</array>
<key>TargetIdentifier</key>
Expand Down
2 changes: 1 addition & 1 deletion tools/pack-ios.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
EASYDEV_PATH="/opt/EasyDev"
EASYDEV_PATH="~/EasyDev"

# temp path
TEMP_PATH="${SRCROOT}/${TARGET_NAME}/tmp"
Expand Down
2 changes: 1 addition & 1 deletion tools/pack-osx.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
EASYDEV_PATH="/opt/EasyDev"
EASYDEV_PATH="~/EasyDev"

# temp path
TEMP_PATH="${SRCROOT}/${TARGET_NAME}/tmp"
Expand Down