1、zsh: command not found: qta-manage
在安裝pip install qtaf --user后,執(zhí)行qta-manage createproject footestproj,報錯zsh: command not found: qta-manage
之前也碰到過,這種問題,就是因為zsh找不到命令路徑導(dǎo)致,我們需要把命令路徑加入到配置里面去。
這里涉及到兩個路徑bash路徑和zsh路徑,bash路徑在~/.bash_profile,zsh路徑在~/.zshrc
我的做法是,在~/.bash_profile加入路徑,在~/.zshrc加載bash路徑,即source ~/.zshrc
如何確定qtaf路徑

如圖,再執(zhí)行一次pip install qtaf --user安裝命令,會顯示他的路徑,我們看第一行,一般命令是在bin路徑,我們只需要把lib換成bin,然后把后面的去掉,這就是命令路徑了。
以下是具體修改點:
1、open ~/.bash_profile
在里面加入export PATH=${PATH}:/Users/yourname/Library/Python/2.7/bin
2、在# User configuration下面,加入一行source ~/.bash_profile,確保每次zsh啟動后,都加載最新的配置文件
3、修改完保存,然后執(zhí)行source ~/.zshrc,退出terminal,再打開,執(zhí)行qta-manage createproject footestproj,可以正常創(chuàng)建文件了。
2、安裝pip install qt4i報錯
剛開始報

python安裝第三方庫,經(jīng)常遇到Permission denied
這里通用解決方法:
就是在后面加上--user
執(zhí)行pip install qt4i --user
又報錯,報

搜了兩篇文章
MacOS中編譯時找不到OpenSSL頭文件的解決方案
大致過程如下:
brew install openssl
安裝后會看見如下提示
A CA file has been bootstrapped using certificates from the SystemRoots
keychain. To add additional certificates (e.g. the certificates added in
the System keychain), place .pem files in
/usr/local/etc/openssl/certs
and run
/usr/local/opt/openssl/bin/c_rehash
This formula is keg-only, which means it was not symlinked into /usr/local,
because Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries.
If you need to have this software first in your PATH run:
echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.zshrc
For compilers to find this software you may need to set:
LDFLAGS: -L/usr/local/opt/openssl/lib
CPPFLAGS: -I/usr/local/opt/openssl/include
意思就是,這個自行安裝的新版并不會覆蓋掉系統(tǒng)自帶的版本。如果你希望你的程序優(yōu)先調(diào)用這個版本,需要自行將之鏈接到環(huán)境變量;如果需要使用此版本編譯軟件,則需要自行在 Makefile 中設(shè)置 LDFLAGS 與 CPPFLAGS 。
當(dāng)然這么做依舊是過于麻煩,經(jīng)查閱資料,有網(wǎng)友給出解決方案:
brew link openssl --force
但是經(jīng)過測試后發(fā)現(xiàn) brew 拒絕鏈接,提示如下:
Warning: Refusing to link: openssl
Linking keg-only openssl means you may end up linking against the insecure,
deprecated system OpenSSL while using the headers from Homebrew's openssl.
Instead, pass the full include/library paths to your compiler e.g.:
-I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib
但是我們依舊可以手動解決這個問題。
通過 brew 安裝的 OpenSSL 的頭文件位于 /usr/local/Cellar/openssl/版本號/include/openssl 文件夾內(nèi),以我的版本為例,即 /usr/local/Cellar/openssl/1.0.2o_2/include/openssl ,在終端內(nèi)執(zhí)行下列代碼:
ln -s /usr/local/Cellar/openssl/1.0.2o_2/include/openssl /usr/local/include
手動創(chuàng)建軟連接即可。然后再次執(zhí)行。
解決Mac OS X 10.11 El Capitan 上 openssl/aes.h file not found 的問題
首先 brew install openssl 發(fā)現(xiàn)已經(jīng)安裝
然后再使用 xcode-select -p 命令查找xcode安裝所在目錄
比如命令得到安裝目錄為:/Applications/Xcode.app/Contents/Developer
再然后進(jìn)入/Applications/Xcode.app/Contents/Developer,查找ssl.h
cd /Applications/Xcode.app/Contents/Developer && find . -name ssl.h
得到ssl.h所在目錄,比如:./Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-migrator/sdk/MacOSX.sdk/usr/include/openssl/ssl.h
然后將整個openssl所在目錄拷貝至/usr/local/include/中:
cp -R /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-migrator/sdk/MacOSX.sdk/usr/include/openssl /usr/local/include/
再次安裝,問題解決
都沒有解決問題。
最后參考安裝qti報錯解決。
具體解決方法:
$ brew install openssl && brew install swig
$ brew --prefix openssl
/usr/local/opt/openssl
$ LDFLAGS="-L$(brew --prefix openssl)/lib" \
CFLAGS="-I$(brew --prefix openssl)/include" \
SWIG_FEATURES="-I$(brew --prefix openssl)/include" \
pip install m2crypto --user
3、qt4i-manage setup運(yùn)行出錯,報

解決方法:
1、pip freeze | grep six 看下six庫版本 qt4i要求six版本>1.11.0
pip install -U six依然報錯
Cannot uninstall 'six'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
最后用sudo pip install six --upgrade --ignore-installed six解決
3、配置xcode項目


登錄后,選擇team為personal team

配置好之后,點“Product”>“Test”,構(gòu)建及運(yùn)行XCTestAgent。如果一切正常,就可以看到xctest安裝到手機(jī)上了。這里要輸入三次電腦密碼,記得勾選始終允許。就可以了
4、fbsimctl報錯
Exception: fbsimctl not found, use brew install
解決辦法參考這里:
# Get the Facebook Tap.
brew tap facebook/fb
# Install fbsimctl from master
brew install fbsimctl --HEAD
依然報錯。
最終解決辦法:
1、自己下載代碼,手動編譯,參考這里
步驟:
1、brew install carthage
2、下載fbsimctl源碼zip包,解壓后,在解壓的文件夾里新建output文件夾
3、執(zhí)行./build.sh fbsimctl build output
4、編譯完成后,執(zhí)行./output/bin/fbsimctl list
如果有輸出類似于這種的,則表示成功。

最后把fbsimctl軟連接到
ln -s /Users/yourname/Documents/software/FBSimulatorControl-master/output/bin/fbsimctl ~/Library/Python/2.7/bin/fbsimctl
/Users/yourname/Library/Python/2.7/bin和~/Library/Python/2.7/bin/是一樣的
最后,直接執(zhí)行fbsimctl,看看是否還是有輸出設(shè)備列表。如果有,表示成功鏈接