Kitica Devicepool Client.
Project description
Kitica Host Client Listener
Setting up Adb/iOS Host Client Listener Service
This host listener configuration service was made for *nix systems.
There is still no support for Windows OS.
Before proceeding to the installation steps, it is important to note that you should have setup the following first:
- Python
- pip
- virtualenv
- adb server if using adb client
- ios deploy for ios client
If you dont have this setup already, feel free to search the web for sources on how to.
Step 1 - Setting up Environment & Python Dependencies
- Clone this repository
- Navigate to the kitica client directory
thisrepository/client
- Run
virtualenv venv
This will create a python virtualenv which the listener service would use.
If you are successful, you would see something like this on your terminal.Using base prefix '/usr' New python executable in /home/joshuarivera/kitica/client/venv/bin/python3 Also creating executable in /home/joshuarivera/kitica/client/venv/bin/python Installing setuptools, pip, wheel... done.
- Activate the created virtual environment instance by running
source venv/bin/activate
This will activate the virtualenv you just created. - With the virtualenv setup, we are now ready to install the python dependencies.
Run:pip install -r requirements.txt
What this does is install all the listed dependencies listed in the requirements.txt fle to the activated virtualenv. - Setup the system environment variable for the virtual environment.
First, open the/thisrepository/client/_set_envs.pth
to set the KITICA_LISTENER_API Environment Variable.import os; os.environ['KITICA_LISTENER_API'] = 'http://kitica.server.api/hosts/listener'
After setting the value for the api server. Copy the file inside the virtualenv.cp _set_envs.pth venv/lib/python3.6/site-packages/
- With the virtual environment setup and dependencies installed, we should now be able to run our android client listener without errors.
# for adb client python android.py # for ios client python ios.py
If no error occured, We are now ready to move to Step 2.
Step 2 - Creating a System Service for the Listener Client.
- Ok, now that our dependencies are good, we can now create a service instance for the listener client. To create a new system service, run:
# for adb client sudo nano /etc/systemd/system/kitica-adb-client.service # for iOS client sudo nano /etc/systemd/system/kitica-ios-client.service
Copy the configuration below, edit the[Unit] Description=Kitica Listener Instance After=network.target [Service] User=changeme Group=changeme WorkingDirectory=/path/to/the/repository/kitica/client Environment="PATH=/path/to/the/repository/kitica/client/venv/bin" ExecStart=/path/to/the/repository/kitica/client/venv/bin/python3 /path/to/the/repository/kitica/client/<abd or ios>.py [Install] WantedBy=multi-user.target
Save then quit. - Now that we have created a service file, we can now try to start it.
sudo systemctl daemon-reload # for adb client sudo systemctl start kitica_android_client # for ios client sudo systemctl start kitica_ios_client
If all goes well, you should not see any error. - For the client to be able to auto start on boot and behave more like a listener, simply run:
# for adb client sudo systemctl enable kitica_android_client # for ios client sudo systemctl enable kitica_ios_client
Check the status after...# for adb client sudo systemctl status kitica_android_client # for ios client sudo systemctl status kitica_ios_client
You should see something like this.● kiticalistener.service - Kitica Android Listener Instance Loaded: loaded (/etc/systemd/system/kiticalistener.service; disabled; vendor preset: enabled) Active: active (running) since Sat 2020-02-08 00:39:40 PST; 1min ago Main PID: 7563 (python3) Tasks: 1 (limit: 4915) CGroup: /system.slice/kiticalistener.service └─7563 /path/to/the repository/client/venv/bin/python3 /path/to/the repository/client/android.py
- Congratulations! You had setup a kitica android client listener as a service.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for kiticaclient-1.1b0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc452c6b4f7f12e496a99298f088ea102d0d1c90f9d43d442cd783a8d0e916fb |
|
MD5 | f417d54248d0a3405c2dd3b55877f2a7 |
|
BLAKE2b-256 | 478c1f0335abd4adc1a0735b6bfc5263eb09f489fc4ce186a2ac3fc620840f28 |