thaliproject / CI

CI project for testing mobile devices
MIT License
2 stars 3 forks source link

CI Environment to Test Mobile devices

Installation

Download the latest JXcore from jxcore.azureedge.net/jxcore/0312/release/jx_osx64v8.zip

git clone https://github.com/thaliproject/ThaliCI
cd ThaliCI
jx install
git clone https://github.com/ThaliTester/TestResults
cd tasker
./clean_nodes.sh
cd ..

Expectations

Virtual Machine

Installed software

The other software

It's expected that all dependencies to be installed via Brew when it's possible.

  1. Install Homebrew - a package manager for OS X:
    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    
  2. Install wget - software for retrieving files using HTTP, HTTPS and FTP:
    brew install wget
    
  3. Install OpenSSL:
    brew install openssl
    brew link --force openssl
    
  4. Install ssh-copy-id - a script that uses ssh to log on to a remote machine (coordination server):
    brew install ssh-copy-id
    brew link ssh-copy-id
    ssh-keygen -t rsa -b 4096
    ssh-copy-id -i ~/.ssh/id_rsa.pub pi@192.168.1.150
    
XCode

During the build process the application is code-signed. The code signing is used in combination with the app ID, the provisioning profile, and entitlements to ensure that the installed application is trusted.

For details, see the 'App Distribution Guide', section Maintaining Your Signing Identities and Certificates.

Note: Make sure that the private key used to sign the application has proper access:

WARNING: You'll probably have to create App ID record: 'com.thali.test' on developer Apple portal

When adding certificates using Xcode, it may happen that the private keys are stored both in the login and in the System keychains. Make sure that the key used for signing is stored only in the System keychain, as the build is executed via the SSH with no access to the UI. Improper setting will cause the signing to fail with an error "User interaction is not allowed."

Other settings
  1. Update the bashrc and .bash_profile with:
    PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:/Users/thali/Library/Android/sdk/platform-tools:/Users/thali/Library/Android/sdk/build-tools/25.0.0:/Users/thali/Library/Android/ndk:/usr/local/bin:${PATH}"
    export ANDROID_HOME="/Users/thali/Library/Android/sdk"
    export PATH
    
  2. Prepare CIGIVEMEMYIP.sh.

    CIGIVEMEMYIP.sh is a script executed by build.sh that prints out an appropriate test server IP address in CI.

    The example below shows how to prepare a file that prints out the IP address and then copy it to the '/usr/local/bin/':

    echo "83.16.22.81" > CIGIVEMEMYIP.sh
    vim CIGIVEMEMYIP.sh
    sudo cp CIGIVEMEMYIP.sh /usr/local/bin/
    
  3. Configure npm to use Sinopia installed on the host machine:
    npm set registry http://192.168.1.100:4873
    npm adduser --registry http://192.168.1.100:4873
    

Adding devices

iOS

Each Apple device has to be added to the provisioning profile. Do the following:

  1. Log on to the iOS dev center.
  2. Go to the Device section under 'Certificates, Identifiers & Profiles'.
  3. Add your device using its UDID. (You can get the UDID using XCode or iTunes.)
  4. Update XCode with the updated provisioning profile. (Go to XCode --> Preferences --> Accounts --> ViewDetails -->Refresh.)

FAQ

I have an error name node_win_onecore is not defined while evaluating condition 'node_win_onecore==1'

This's known error. It happens when npm install is used instead of jx install improperly, i.e. when npm downloads native dependency that uses leveldown-mobile. Please keep in mind leveldown-mobile can only be used with JXCore, but not with Node.

So solution is to check all usages of npm and validate that it doesn't install packages that to be compiled for mobile platforms.

See the details thaliproject/Thali_CordovaPlugin#1509

Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.