1、安裝依賴
- Jdk 8+
- Android SDK 28
- adb installed and setup correctly in the env
- a local/remote MySql Database
- Angular CLI: 1.7.4 (Currently the higher verison of Angular CLI might not work. we are working ont the migration)
- Node: 10.15.0
2、啟動mysql
mysql.server start
2.1、登錄數據庫:
mysql -u root -p
密碼:xxx
3、創建數據庫
CREATE DATABASE IF NOT EXISTS `uicddb` DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
grant ALL PRIVILEGES on uicddb.* to root@'%' identified by '123456';
flush privileges;
3、導入數據庫文件
source "/Users/myuser/Desktop/bak/android-uiconductor/backend/src/com/google/uicd/backend/recorder/db/initdb.sql";
4、修改配置文件
在根目錄的release目錄下有個release/uicd.cfg文件:
修改數據庫連接字符串:
mysqlconnectionstr=jdbc:mysql://localhost:3306/uicddb?autoReconnect=true&user=root&password=admin&useUnicode=true&characterEncoding=utf-8
5、在release下面運行start.sh就可以啟動
/start.sh
過程中的問題解決:
1、osascript: mac_chrome.scpt: No such file or directory
解決:
打開…./bak/android-uiconductor/release/start.sh文件,里面有這一段代碼,其中osascript mac_chrome.scpt是未實現的,需要實現:
實現方法:
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --disable-web-security --chrome-frame --user-data-dir="$PWD" --app="file://$PWD/dist/index.html"2、初始打開瀏覽器特別慢:
原因是因為加載的一個jquery.min.js文件是從google拉取的,因為要FQ,所以特別慢,需要改一下,使用國內的,或者下載下來放在文件目錄中;
https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js