510.1.1
by Girish Rawat
Improved READMEs |
1 |
Building the app
|
2 |
================
|
|
3 |
||
4 |
### For the desktop
|
|
5 |
||
6 |
Install the following build dependencies: |
|
7 |
||
8 |
sudo apt-get install libtag1-dev libpam0g-dev python3
|
|
9 |
||
10 |
Then open the CMakeLists.txt file in Qt Creator, and ensure that the kit |
|
11 |
selected on the left sidebar (just above the green "Run" button) is "Desktop" |
|
12 |
||
13 |
### For a device
|
|
14 |
||
15 |
If you don't have one already, you'll need to create an armhf chroot to |
|
16 |
cross-compile the app (also do this if you have an older armhf chroot, for |
|
17 |
example 14.04 and current target is 14.10. You can first delete the old target |
|
18 |
and then create a current one). Here's how: |
|
19 |
||
20 |
1. In Qt Creator, open the CMakeLists.txt file
|
|
21 |
2. Go to Tools > Options > Ubuntu > Click
|
|
22 |
2. Click on Create Click Target
|
|
23 |
3. Follow the prompts to generate the chroot. You will be asked for your sudo
|
|
24 |
password |
|
25 |
4. Once created, you'll need to add the build dependencies for the app:
|
|
26 |
- Click on the Maintain button on your chroot
|
|
27 |
- On the terminal prompt that is started, type
|
|
28 |
apt-get install libtag1-dev:armhf libpam0g-dev:armhf python3 |
|
29 |
- Close the terminal when the installation finishes
|
|
30 |
5. Now you can either do a clean checkout and wait to be prompted by Qt Creator
|
|
31 |
to add the armhf kit, or alternatively: |
|
32 |
6. Go to the Projects tab > Add kit and then select the UbuntuSDK armhf kit
|
|
33 |
||
34 |
Additionally, you'll have to tell Qt Creator that you are doing a build for a |
|
35 |
device to ultimately create a click package for installation: |
|
36 |
||
37 |
1. In Qt Creator, go to the Projects tab on the sidebar
|
|
38 |
2. Click on the "Build" subtab of the "UbuntuSDK for armhf..." tab
|
|
39 |
3. Then go to the "CMake arguments" text field and add "-DCLICK_MODE=on"
|
|
40 |
without the quotes |
|
41 |
||
42 |
Before starting the build make sure to select the "UbuntuSDK" kit on Qt |
|
43 |
Creator's left sidebar (just above the green "Run" button). |
|
44 |
||
45 |
### Doing the build
|
|
46 |
||
47 |
Ensure you've selected the kit you want for your build and press the build |
|
48 |
button on Qt Creator's left sidebar (or alternatively Ctrl+B). |
|
49 |
||
50 |
||
51 |
Running the app
|
|
52 |
===============
|
|
53 |
||
54 |
### On the desktop
|
|
55 |
||
56 |
No additional steps are required before running the app on the desktop. |
|
57 |
||
58 |
You can pass two switches to run in phone or tablet mode from the desktop: |
|
59 |
||
60 |
-p for phone mode |
|
61 |
-t for tablet mode |
|
62 |
||
63 |
||
64 |
### On a device
|
|
65 |
||
66 |
Due to Qt Creator's bug #1312094 in launchpad.net, there needs to be a manual
|
|
67 |
workaround done before the app can run on the device: |
|
68 |
||
69 |
1. Modify the desktop.in file: change the Exec line to read:
|
|
70 |
Exec=lib/arm-linux-gnueabihf/bin/@EXEC@ |
|
71 |
||
72 |
Remember to revert this temporary change if you are building a click package or |
|
73 |
if you're making other changes to be committed to the code! |
|
74 |
||
75 |
### Starting the app
|
|
76 |
||
77 |
Ensure you've selected the kit you want for your build and press the run |
|
78 |
button on Qt Creator's left sidebar (or alternatively Ctrl+R). |
|
79 |
||
80 |
If the app hasn't been built yet, or if there are pending changes that require |
|
81 |
a build, the app will automatically be built first before running. |
|
82 |
||
83 |
If you're starting the app on a device, the build will be copied over and the |
|
84 |
code will run unconfined. |
|
85 |
||
86 |
||
87 |
Building a click package
|
|
88 |
========================
|
|
89 |
||
90 |
There are two alternative ways of building a click package. |
|
91 |
||
92 |
### Using Qt Creator
|
|
93 |
||
94 |
1. Ensure you've selected the UbuntuSDK for armhf kit on Qt Creator's sidebar
|
|
95 |
2. Click on Publish on the sidebar
|
|
96 |
3. Click on "Create package"
|
|
97 |
4. If all goes well, you'll find the final click package in the build directory
|
|
98 |
||
99 |
Notes: |
|
100 |
- You can see the output of the click build if you click on Edit on the sidebar
|
|
101 |
and then "Application Output" at the bottom. This is useful to identify any |
|
102 |
failures during the build |
|
103 |
- Run `sudo apt-get install click-reviewers-tools` to enable click package |
|
104 |
validation in Qt Creator. You might need to restart Qt Creator after you've |
|
105 |
installed them for it to detect them |
|
106 |
||
107 |
### Using click-buddy
|
|
108 |
||
109 |
1. Install phablet-tools: `sudo apt-get install phablet-tools` |
|
110 |
2. Run click-buddy in your source tree:
|
|
111 |
click-buddy --dir . --arch armhf --framework ubuntu-sdk-14.04 |
|
112 |
3. Once finished, click-buddy will tell you the location of your source package
|
|
113 |
||
114 |
||
115 |
Installing a click package
|
|
116 |
==========================
|
|
117 |
||
118 |
First of all, ensure you've got a working Ubuntu device attached over USB to |
|
119 |
your host computer |
|
120 |
||
121 |
### Manually
|
|
122 |
||
123 |
Run the following commands to manually install the click package (replace 0.5 |
|
124 |
with the version of your package): |
|
125 |
||
126 |
adb push com.ubuntu.filemanager_0.3.latest_armhf.click /home/phablet/
|
|
127 |
adb shell
|
|
128 |
sudo -H -u phablet pkcon install-local /home/phablet/com.ubuntu.filemanager_0.3_armhf.click
|
|
129 |
||
130 |
### Using click-buddy
|
|
131 |
||
132 |
You can add the --provision argument to the previous command to install the |
|
133 |
click package on the device. |
|
134 |
||
135 |
### Starting the app
|
|
136 |
||
137 |
1. Either kill unity8 with `pkill unity8` or restart the system for the Apps |
|
138 |
(click) scope to pick up your newly installed click package |
|
139 |
2. Search for Reminders in the Apps scope and tap on its icon to start it
|
|
140 |
3. You'll find the runtime logs at ~/.cache/upstart/application-click/
|
|
141 |
||
142 |
||
143 |
Uninstalling a click package
|
|
144 |
============================
|
|
145 |
||
146 |
Run the following commands, replacing the version of the click package you want |
|
147 |
to uninstall: |
|
148 |
||
149 |
adb shell
|
|
150 |
sudo -iu phablet
|
|
151 |
sudo click unregister com.ubuntu.filemanager 0.3
|