Skip to content

Commit

Permalink
rename MonkeyDevPort to MonkeyDevDevicePort
Browse files Browse the repository at this point in the history
  • Loading branch information
AloneMonkey committed Jul 8, 2017
1 parent 7199c6a commit aa29271
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 24 deletions.
10 changes: 5 additions & 5 deletions README-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ sudo ./md-install

不设置的话,ip默认为`localhost`,port默认为`2222`

当然你也可以在`~/.zshrc`或其它profile里面设置`MonkeyDevDevice``MonkeyDevPort`
当然你也可以在`~/.zshrc`或其它profile里面设置`MonkeyDevDeviceIP``MonkeyDevDevicePort`

```
export MonkeyDevDevice=
export MonkeyDevPort=
export MonkeyDevDeviceIP=
export MonkeyDevDevicePort=
```

查看log的会可以使用`idevicesyslog`查看,毕竟带颜色。。。。
Expand All @@ -76,8 +76,8 @@ export MonkeyDevPort=
|--|--|
|MonkeyDevBuildPackageOnAnyBuild|每次build都生成deb包|
|MonkeyDevCopyOnBuild|build的时将deb包拷贝到设备的/var/root/MonkeyDevBuilds/目录|
|MonkeyDevDevice|目标设备的ip地址,默认USB连接,localhost|
|MonkeyDevPort|目标设备的端口,默认2222|
|MonkeyDevDeviceIP|目标设备的ip地址,默认USB连接,localhost|
|MonkeyDevDevicePort|目标设备的端口,默认2222|
|MonkeyDevInstallOnAnyBuild|每次build都将deb安装到设备|
|MonkeyDevInstallOnProfiling|点击Profile才将deb安装到设备|
|MonkeyDevRespringOnInstall|安装的时候重启SpringBoard|
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ The Bash profile file also can export variable。

```
export MonkeyDevDeviceIP=
export MonkeyDevPort=
export MonkeyDevDevicePort=
```

use `idevicesyslog` to show log print.
Expand All @@ -84,7 +84,7 @@ use `idevicesyslog` to show log print.
|MonkeyDevBuildPackageOnAnyBuild|create package on any type of build. |
|MonkeyDevCopyOnBuild|during any build, copy the target (executable) to the device at /var/root/iOSOpenDevBuilds/|
|MonkeyDevDeviceIP|the host name (e.g. MyiPhone.local) or IP address (e.g. 192.168.1.101) of the device you wish to use during development.|
|MonkeyDevPort|connect port of the device|
|MonkeyDevDevicePort|connect port of the device|
|MonkeyDevInstallOnAnyBuild|install the package on the device on any type of build. |
|MonkeyDevInstallOnProfiling|during a Build For Profiling (Command-Shift-I or Product > Build For > Build For Profiling), build the project's Debian package, copy the package to the device at /var/root/MonkeyDevPackages (using SSH) and install the package (using SSH and running dpkg locally on the device)|
|MonkeyDevRespringOnInstall|after the Debian package has been built and installed, respring (i.e. kill and relaunch SpringBoard) the device.|
Expand Down
34 changes: 17 additions & 17 deletions bin/md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ export activeActionArg

export MonkeyDevPath="/opt/MonkeyDev"
#默认设备ip
export DefaultDevice="localhost"
export DefaultDeviceIP="localhost"
#默认端口号
export DefaultPort="2222"
export DefaultDevicePort="2222"

export userName="${SUDO_USER-$USER}"
export userGroup=`id -g $userName`
Expand Down Expand Up @@ -519,14 +519,14 @@ function managePackageOnDevice() # args: manageAction, packageFileOrName, hostAd
hostAddress="$MonkeyDevDeviceIP"

[[ $hostAddress != "" ]] || \
hostAddress="$DefaultDevice" && echo "Host address not provided and environment variable MonkeyDevDeviceIP is not set or is empty, use default $DefaultDevice"
hostAddress="$DefaultDeviceIP" && echo "Host address not provided and environment variable MonkeyDevDeviceIP is not set or is empty, use default $DefaultDeviceIP"
fi

if [[ $hostPort == "" ]]; then

hostPort="$MonkeyDevPort"
hostPort="$MonkeyDevDevicePort"

[[ $hostPort != "" ]] || hostPort="$MonkeyDevPort"
[[ $hostPort != "" ]] || hostPort="$MonkeyDevDevicePort"

fi

Expand Down Expand Up @@ -567,15 +567,15 @@ function runFuncOnDevice() # args: function, hostAddress, hostPort
hostAddress="$MonkeyDevDeviceIP"

[[ $hostAddress != "" ]] || \
hostAddress="$DefaultDevice" && echo "Host address not provided and environment variable MonkeyDevDeviceIP is not set or is empty, use default $DefaultDevice"
hostAddress="$DefaultDeviceIP" && echo "Host address not provided and environment variable MonkeyDevDeviceIP is not set or is empty, use default $DefaultDeviceIP"
fi

if [[ $hostPort == "" ]]; then

hostPort="$MonkeyDevPort"
hostPort="$MonkeyDevDevicePort"

[[ $hostPort != "" ]] || \
hostPort="$DefaultPort"
hostPort="$DefaultDevicePort"

fi

Expand Down Expand Up @@ -794,14 +794,14 @@ function xcodeBuildPhase() # no args
[[ $MonkeyDevDeviceIP != "" ]] || \
MonkeyDevDeviceIP=`getBashProfileEnvVarValue "MonkeyDevDeviceIP"`
[[ $MonkeyDevDeviceIP != "" ]] || \
MonkeyDevDeviceIP="$DefaultDevice" && echo "use default $DefaultDevice"
MonkeyDevDeviceIP="$DefaultDeviceIP" && echo "use default $DefaultDeviceIP"
#如果编译设置里面MonkeyDevPort为空的话,就从用户的profile里面去拿,否则使用默认值
[[ $MonkeyDevPort != "" ]] || \
MonkeyDevPort=`getBashProfileEnvVarValue "MonkeyDevPort"`
#如果编译设置里面MonkeyDevDevicePort为空的话,就从用户的profile里面去拿,否则使用默认值
[[ $MonkeyDevDevicePort != "" ]] || \
MonkeyDevDevicePort=`getBashProfileEnvVarValue "MonkeyDevDevicePort"`
[[ $MonkeyDevPort != "" ]] || \
MonkeyDevPort="$DefaultPort"
[[ $MonkeyDevDevicePort != "" ]] || \
MonkeyDevDevicePort="$DefaultDevicePort"
#验证必要文件的存在
requireFile "$builtExecutable" false
Expand Down Expand Up @@ -844,7 +844,7 @@ function xcodeBuildPhase() # no args
#拷贝到设备的/var/root/MonkeyDevBuilds/
if [[ "$MonkeyDevDeviceIP" != "" ]]; then
copyFileToDevice "$builtExecutable" "/var/root/MonkeyDevBuilds/$PROJECT_NAME" "$MonkeyDevDeviceIP" "$MonkeyDevPort"
copyFileToDevice "$builtExecutable" "/var/root/MonkeyDevBuilds/$PROJECT_NAME" "$MonkeyDevDeviceIP" "$MonkeyDevDevicePort"
else
# build setting MonkeyDevDeviceIP is empty #
panic 1 "Unable to copy executable to device since build setting MonkeyDevDeviceIP is not set or is empty and it is not exported in your Bash personal initialization file"
Expand Down Expand Up @@ -879,12 +879,12 @@ function xcodeBuildPhase() # no args
packageFileName="`getPackageFileNameUsingControlFile \"$packageDirectory/DEBIAN/control\"`.deb"
# install package on device #
managePackageOnDevice "install" "$allPackagesDir/$packageFileName" "$MonkeyDevDeviceIP" "$MonkeyDevPort"
managePackageOnDevice "install" "$allPackagesDir/$packageFileName" "$MonkeyDevDeviceIP" "$MonkeyDevDevicePort"
# respring? #
if [[ "$MonkeyDevRespringOnInstall" == "YES" ]]; then
echo "Respringing device..."
runFuncOnDevice "respring" "$MonkeyDevDeviceIP" "$MonkeyDevPort"
runFuncOnDevice "respring" "$MonkeyDevDeviceIP" "$MonkeyDevDevicePort"
fi
else
# build setting MonkeyDevDeviceIP is empty #
Expand Down

0 comments on commit aa29271

Please sign in to comment.