├── .github
├── ISSUE_TEMPLATE
│ ├── backend-bug-report.md
│ ├── feature-request.md
│ └── frontend-bug-report.md
├── PULL_REQUEST_TEMPLATE.md
└── workflows
│ ├── lint.yml
│ └── swift.yml
├── .gitignore
├── .swiftlint.yml
├── Default-568h@2x.png
├── LICENSE
├── Launcher
├── build.sh
├── launch.sh
└── run.py
├── Manager
├── .swiftlint.yml
├── Package.swift
├── Sources
│ └── RDMUICManager
│ │ ├── BuildController.swift
│ │ ├── CLI.swift
│ │ ├── Device.swift
│ │ ├── FileLogger.swift
│ │ ├── Shell.swift
│ │ └── main.swift
└── Tests
│ ├── LinuxMain.swift
│ └── RDMUICManagerTests
│ └── RDMUICManagerTests.swift
├── Podfile
├── README.md
├── RealDeviceMap-UIControl.xcodeproj
├── project.pbxproj
├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
└── xcshareddata
│ └── xcschemes
│ ├── RealDeviceMap-UIControl.xcscheme
│ └── xcschememanagement.plist
├── RealDeviceMap-UIControl
├── Config.swift
├── DeviceConfig
│ ├── DeviceConfig.swift
│ ├── DeviceConfigProtocol.swift
│ ├── DeviceIPhoneNormal.swift
│ ├── DeviceRatio1333.swift
│ └── DeviceRatio1775.swift
├── DeviceCoordinate.swift
├── Info.plist
├── Log.swift
├── Misc.swift
└── RealDeviceMap_UIControlUITests.swift
└── Unused
├── AppDelegate.swift
├── Assets.xcassets
├── AppIcon.appiconset
│ └── Contents.json
└── Contents.json
├── Base.lproj
├── LaunchScreen.storyboard
└── Main.storyboard
├── Info.plist
└── ViewController.swift
/.github/ISSUE_TEMPLATE/backend-bug-report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Backend Bug Report
3 | about: Create a report to help us improve
4 | title: "[Backend Bug Report] Title"
5 | labels: backend, bug
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Describe the bug**
11 | A clear and concise description of what the bug is.
12 |
13 | **To Reproduce**
14 | Steps to reproduce the behavior:
15 | 1. Go to '...'
16 | 2. Click on '....'
17 | 3. Scroll down to '....'
18 | 4. See error
19 |
20 | **Expected behavior**
21 | A clear and concise description of what you expected to happen.
22 |
23 | **Screenshots**
24 | If applicable, add screenshots to help explain your problem.
25 |
26 | **System**
27 | - Running in docker: [yes|no]
28 | - Docker Engine Version: [if applicable, e.g. 19.0]
29 | - Host OS: [e.g. Ubuntu 18.04]
30 | - RDM Version [e.g. 2.0.0]
31 |
32 | **Additional context**
33 | Add any other context about the problem here.
34 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature-request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature Request
3 | about: Suggest an idea for this project
4 | title: "[Feature Request] Title"
5 | labels: enhancement
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Is your feature request related to a problem? Please describe.**
11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12 |
13 | **Describe the solution you'd like**
14 | A clear and concise description of what you want to happen.
15 |
16 | **Describe alternatives you've considered**
17 | A clear and concise description of any alternative solutions or features you've considered.
18 |
19 | **Additional context**
20 | Add any other context or screenshots about the feature request here.
21 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/frontend-bug-report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Frontend Bug Report
3 | about: Create a report to help us improve
4 | title: "[Frontend Bug Report] Title"
5 | labels: bug, frontend
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Describe the bug**
11 | A clear and concise description of what the bug is.
12 |
13 | **To Reproduce**
14 | Steps to reproduce the behavior:
15 | 1. Go to '...'
16 | 2. Click on '....'
17 | 3. Scroll down to '....'
18 | 4. See error
19 |
20 | **Expected behavior**
21 | A clear and concise description of what you expected to happen.
22 |
23 | **Screenshots**
24 | If applicable, add screenshots to help explain your problem.
25 |
26 | **System**
27 | - Running in docker: [yes|no]
28 | - Docker Engine Version: [if applicable, e.g. 19.0]
29 | - Host OS: [e.g. Ubuntu 18.04]
30 | - RDM Version [e.g. 2.0.0]
31 |
32 | **Client**
33 | - OS: [e.g. Any, iOS, Windows]
34 | - Browser [e.g. Chrome, Safari]
35 |
36 | **Additional context**
37 | Add any other context about the problem here.
38 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | ## Description
4 |
5 |
6 | ## Motivation and Context
7 |
8 |
9 |
10 | ## How Has This Been Tested?
11 |
12 |
13 |
14 |
15 | ## Screenshots (if appropriate):
16 |
17 | ## Types of changes
18 |
19 | - [ ] Bug fix (non-breaking change which fixes an issue)
20 | - [ ] New feature (non-breaking change which adds functionality)
21 | - [ ] Breaking change (fix or feature that would cause existing functionality to change)
22 |
23 | ## Checklist:
24 |
25 |
26 |
27 |
28 |
29 | - [ ] My code follows the code style of this project.
30 | - [ ] My change requires a change to the documentation.
31 | - [ ] I have updated the documentation accordingly.
32 |
--------------------------------------------------------------------------------
/.github/workflows/lint.yml:
--------------------------------------------------------------------------------
1 | name: Lint
2 |
3 | on: [push, pull_request]
4 |
5 | jobs:
6 | UICSwiftLint:
7 | runs-on: ubuntu-latest
8 | steps:
9 | - uses: actions/checkout@v1
10 | - name: GitHub Action for SwiftLint with --strict for UIC
11 | uses: norio-nomura/action-swiftlint@3.1.0
12 | with:
13 | args: --strict
14 | ManagerSwiftLint:
15 | runs-on: ubuntu-latest
16 | steps:
17 | - uses: actions/checkout@v1
18 | - name: GitHub Action for SwiftLint with --strict for Manager
19 | uses: norio-nomura/action-swiftlint@3.1.0
20 | with:
21 | args: --strict --path Manager
22 |
--------------------------------------------------------------------------------
/.github/workflows/swift.yml:
--------------------------------------------------------------------------------
1 | name: Swift
2 |
3 | on: [push, pull_request]
4 |
5 | jobs:
6 | UICBuildTesting:
7 | runs-on: macos-latest
8 | steps:
9 | - uses: actions/checkout@v1
10 | - name: Install Dependences
11 | run: |
12 | pod repo update
13 | pod install
14 | shell: bash
15 | - name: Build for Testing
16 | run: xcodebuild build-for-testing CODE_SIGNING_ALLOWED=NO -workspace RealDeviceMap-UIControl.xcworkspace/ -scheme RealDeviceMap-UIControl -destination generic/platform=iOS
17 | ManagerBuildDebug:
18 | runs-on: macos-latest
19 | steps:
20 | - uses: actions/checkout@v1
21 | - name: Resolve
22 | working-directory: Manager
23 | run: swift package resolve
24 | - uses: actions/cache@v1
25 | with:
26 | path: Manager/.build
27 | key: ${{ runner.os }}-debug-spm-${{ hashFiles('Manager/Package.resolved') }}
28 | - name: Build
29 | working-directory: Manager
30 | run: swift build -v -c debug
31 | - name: Test
32 | working-directory: Manager
33 | run: swift test -v -c debug
34 | ManagerBuildRelease:
35 | runs-on: macos-latest
36 | steps:
37 | - uses: actions/checkout@v1
38 | - name: Resolve
39 | working-directory: Manager
40 | run: swift package resolve
41 | - uses: actions/cache@v1
42 | with:
43 | path: Manager/.build
44 | key: ${{ runner.os }}-release-spm-${{ hashFiles('Manager/Package.resolved') }}
45 | - name: Build
46 | working-directory: Manager
47 | run: swift build -v -c release
48 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # MacOS
2 | .DS_Store
3 |
4 | # Xcode
5 | RealDeviceMap-UIControl.xcodeproj/project.xcworkspace/xcuserdata/*
6 | .idea/
7 | Manager/RDM-UIC-Manager.xcodeproj/
8 | Manager/.build/
9 | Manager/Package.resolved
10 |
11 | # Pods
12 | Podfile.lock
13 | Pods/
14 | *.xcworkspace
15 |
16 | # Manager
17 | Manager/logs/
18 | Manager/db.sqlite
19 | Manager/StORMlog.txt
20 | Manager/RDM-UIC-Manager
21 |
--------------------------------------------------------------------------------
/.swiftlint.yml:
--------------------------------------------------------------------------------
1 | included:
2 | - RealDeviceMap-UIControl
3 | disabled_rules:
4 | - nesting
5 | - legacy_hashing
6 | identifier_name:
7 | excluded:
8 | - i
9 | - x
10 | - y
11 | - id
12 | - cp
13 |
--------------------------------------------------------------------------------
/Default-568h@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RealDeviceMap/RealDeviceMap-UIControl/588c5c3497c1baf656a3ad27946347f54541dd73/Default-568h@2x.png
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 |
635 | Copyright (C)
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | Copyright (C)
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------
/Launcher/build.sh:
--------------------------------------------------------------------------------
1 | #!/usr/local/bin/bash
2 |
3 | ####### EDIT VARIABLES BELOW
4 |
5 | # Edit device name array below
6 | DEVICE_NAMES=(
7 | "DEVICE NAME 1"
8 | "DEVICE NAME 2"
9 | )
10 |
11 | # Full path of UIControl workspace (ie. "/Source/RDM/_Base/RealDeviceMap-UIControl.xcworkspace")
12 | WORKSPACE_PATH=""
13 |
14 | # Desired location of where you want your DerivedData folders to go (ie. "/Source/RDM/DerivedData")
15 | DERIVEDDATA_PATH=""
16 |
17 | ####### BEGIN SCRIPT
18 |
19 | clear
20 |
21 | printf "[$(date '+%Y-%m-%d %H:%M:%S')] %s\n" "Begin building UIControl"
22 |
23 | xcodebuild build-for-testing -workspace "${WORKSPACE_PATH}" -scheme RealDeviceMap-UIControl -allowProvisioningUpdates -allowProvisioningDeviceRegistration -destination "generic/platform=iOS" -derivedDataPath "${DERIVEDDATA_PATH}/_Base"
24 |
25 | for i in "${DEVICE_NAMES[@]}"
26 | do
27 | printf "[$(date '+%Y-%m-%d %H:%M:%S')] %s\n" "Copying DerivedData folder to ${DERIVEDDATA_PATH}/${i}..."
28 | cp -r "${DERIVEDDATA_PATH}/_Base" "${DERIVEDDATA_PATH}/${i}"
29 | done
30 |
31 | printf "[$(date '+%Y-%m-%d %H:%M:%S')] %s\n" "Finished building UIControl"
32 |
33 | # Uncomment below if you want to launch the UIControl instances after the build completes
34 | #./launch.sh
35 |
36 | ####### END SCRIPT
37 |
--------------------------------------------------------------------------------
/Launcher/launch.sh:
--------------------------------------------------------------------------------
1 | #!/usr/local/bin/bash
2 |
3 | # DON'T EDIT
4 | COMMAND_TEMPLATE="python2 run.py -u %s -n '%s' -a %s -f %s -fc %s -eg %s"
5 |
6 | ####### EDIT VARIABLES BELOW
7 |
8 | # Edit device array below - be sure to change UUID, DEVICE NAME and ACCOUNT MANAGER FLAG only.
9 | # - ACCOUNT MANAGER FLAG is a switch to use account manager or not (true/false)
10 | # - FAST IV FLAG is a switch to use the new fast iv scanning (true/false)
11 | # - MAX FAILED COUNT is the max number of failed scans before terminating the test (default is "5")
12 | # - MAX EMPTY GMO is the max number of empty GMO scans before terminating the test (default is "5")
13 | declare -A DEVICE_COMMANDS
14 | DEVICE_COMMANDS=(
15 | ["DEVICE NAME 1"]=$(printf "${COMMAND_TEMPLATE}" "UUID 1" "DEVICE NAME 1" "ACCOUNT MANAGER FLAG 1" "FAST IV FLAG 1" "MAX FAILED COUNT 1" "MAX EMPTY GMO 1")
16 | ["DEVICE NAME 2"]=$(printf "${COMMAND_TEMPLATE}" "UUID 2" "DEVICE NAME 2" "ACCOUNT MANAGER FLAG 2" "FAST IV FLAG 2" "MAX FAILED COUNT 2" "MAX EMPTY GMO 2")
17 | )
18 |
19 | # Config options
20 | TIMER=600 # number of seconds before terminating a tmux session and starting a new one
21 | SLEEP=120 # number of seconds to wait before moving on to the next batch of instances
22 | MAX_STARTING=2 # max number of instances to start concurrently
23 |
24 | HOSTIP= # ip of the RDM host database
25 | PORT= # port of the RDM host database
26 | DBNAME= # name of the RDM host database
27 | DB_USER= # user account of the RDM host database
28 | PASSWORD='' # password for the DB_USER account of the RDM host database
29 |
30 | ####### BEGIN SCRIPT
31 |
32 | while True
33 | do
34 | starting=0
35 | clear
36 |
37 | for i in "${!DEVICE_COMMANDS[@]}"
38 | do
39 | if (tmux ls | grep -wq "$i") >/dev/null 2>/dev/null; then
40 | LAST_SEEN=$(echo $(MYSQL_PWD="${PASSWORD}" mysql -u ${DB_USER} -h ${HOSTIP} -P ${PORT} -e "select (UNIX_TIMESTAMP(NOW()) - last_seen) from device where uuid = '${i}'" ${DBNAME}))
41 | TRIMMED=$(echo ${LAST_SEEN} | awk {'print $4'})
42 |
43 | if [ "${TRIMMED:0}" -gt "${TIMER}" ] && [ "${TRIMMED:0}" -lt 1540000000 ]; then
44 | printf "[$(date '+%Y-%m-%d %H:%M:%S')] %s\n" "${i} hasn't been seen in over ${TIMER} second(s). Restarting..."
45 | ((starting++))
46 |
47 | tmux kill-session -t "$i" >/dev/null 2>&1
48 | tmux new -d -s "$i" "${DEVICE_COMMANDS[$i]}";
49 | else
50 | printf "[$(date '+%Y-%m-%d %H:%M:%S')] %s\n" "${i} was seen ${TRIMMED} second(s) ago"
51 | fi
52 | else
53 | printf "[$(date '+%Y-%m-%d %H:%M:%S')] %s\n" "${i} session not found. Starting new session..."
54 | ((starting++))
55 | tmux new -d -s "$i" "${DEVICE_COMMANDS[$i]}";
56 | fi
57 |
58 | if [ "${starting}" -eq "${MAX_STARTING}" ]; then
59 | remaining=${SLEEP}
60 | tput sc
61 | while [[ ${remaining} -gt 0 ]];
62 | do
63 | tput rc; tput el
64 | printf "[$(date '+%Y-%m-%d %H:%M:%S')] %s" "Waiting ${remaining} second(s) before continuing with the next batch of ${MAX_STARTING} instances..."
65 | sleep 1
66 | ((remaining--))
67 | done
68 | tput rc; tput el;
69 | starting=0
70 | fi
71 | done
72 |
73 | remaining=${SLEEP}
74 | tput sc
75 | while [[ ${remaining} -gt 0 ]];
76 | do
77 | tput rc; tput el
78 | printf "[$(date '+%Y-%m-%d %H:%M:%S')] %s" "Waiting ${remaining} second(s) before beginning the next round..."
79 | sleep 1
80 | ((remaining--))
81 | done
82 | done
83 |
84 | ####### END SCRIPT
85 |
--------------------------------------------------------------------------------
/Launcher/run.py:
--------------------------------------------------------------------------------
1 | import argparse
2 | import sys
3 | import shlex
4 | import subprocess
5 | from datetime import datetime
6 |
7 | ####### EDIT VARIABLES BELOW
8 |
9 | backend_url = '' # url to RDM api (ie. http://10.0.0.1:9001)
10 | workspace = '' # full path of UIControl workspace (ie. '/Source/RDM/_Base/RealDeviceMap-UIControl.xcworkspace')
11 | derived_data_base_path = '' # desired location of where your DerivedData folder is from build.sh (ie. '/Source/RDM/DerivedData')
12 | destination_timeout = 90 # max number of seconds to wait before terminating a process when connecting to a device
13 | idle_timeout = 30 # max number of seconds of idle time before terminating a process
14 |
15 | ####### BEGIN SCRIPT
16 |
17 | parser = argparse.ArgumentParser()
18 | parser.add_argument("-uuid", "-u")
19 | parser.add_argument("-name", "-n")
20 | parser.add_argument("-acct_mgr", "-a", default="false")
21 | parser.add_argument("-fast_iv", "-f", default="false")
22 | parser.add_argument("-maxFailedCount", "-fc", default="5")
23 | parser.add_argument("-maxEmptyGMO", "-eg", default="5")
24 |
25 | args = parser.parse_args()
26 |
27 | device_id = args.uuid
28 | device_name = args.name
29 | enable_account_manager = args.acct_mgr
30 | fast_iv = args.fast_iv
31 | max_failed_count = args.maxFailedCount
32 | max_empty_gmo = args.maxEmptyGMO
33 | derived_data_path = '{}/{}'.format(derived_data_base_path, device_name)
34 |
35 | while True:
36 | print '[{}] Attempting to connect to device: {}'.format(datetime.now().time().strftime('%H:%M:%S'), device_name)
37 | process = subprocess.Popen(shlex.split('xcodebuild test-without-building -workspace "{}" -scheme "RealDeviceMap-UIControl" -destination "id={}" -destination-timeout {} -derivedDataPath "{}" name="{}" backendURL="{}" enableAccountManager="{}" fastIV="{}" maxFailedCount="{}" maxEmptyGMO="{}"'
38 | .format(workspace, device_id, destination_timeout, derived_data_path, device_name, backend_url, enable_account_manager, fast_iv, max_failed_count, max_empty_gmo)), stdout=subprocess.PIPE)
39 | loop_start = datetime.now()
40 |
41 | while True:
42 | output = process.stdout.readline()
43 | if output == '' and process.poll() is not None:
44 | break
45 | if output:
46 | if 'tmp//.safeMode-' in output or 'Received signal 5' in output or 'Lost connection to test process' in output or 'Unable to find device with identifier' in output or 'Early unexpected exit' in output:
47 | process.terminate()
48 | else:
49 | loop_start = datetime.now()
50 | print '[{}] {}'.format(datetime.now().time().strftime('%H:%M:%S'), output.strip())
51 | else:
52 | loop_now = datetime.now()
53 | difference = loop_now - loop_start
54 |
55 | if (difference.seconds > idle_timeout):
56 | print '[{}] Terminating connection to device {} for exceeding the maximum allowed idle time of {} seconds.'.format(loop_now.time().strftime('%H:%M:%S'), device_name, idle_timeout)
57 | process.terminate()
58 | else:
59 | print '[{}] Connection to device {} has been idle for {} seconds...'.format(loop_now.time().strftime('%H:%M:%S'), device_name, difference.seconds)
60 |
61 | rc = process.poll()
62 |
63 | ####### END SCRIPT
--------------------------------------------------------------------------------
/Manager/.swiftlint.yml:
--------------------------------------------------------------------------------
1 | included:
2 | - Sources
3 | disabled_rules:
4 | - nesting
5 | - legacy_hashing
6 | identifier_name:
7 | excluded:
8 | - i
9 | - x
10 | - id
11 | - cp
12 |
--------------------------------------------------------------------------------
/Manager/Package.swift:
--------------------------------------------------------------------------------
1 | // swift-tools-version:4.1
2 |
3 | import PackageDescription
4 |
5 | let package = Package(
6 | name: "RDM-UIC-Manager",
7 | products: [],
8 | dependencies: [
9 | .package(url: "https://github.com/PerfectlySoft/Perfect-HTTPServer.git", .upToNextMinor(from: "3.0.18")),
10 | .package(url: "https://github.com/SwiftORM/SQLite-StORM.git", .upToNextMinor(from: "3.1.0"))
11 | ],
12 | targets: [
13 | .target(
14 | name: "RDMUICManager",
15 | dependencies: [
16 | "PerfectHTTPServer",
17 | "SQLiteStORM"
18 | ]
19 | ),
20 | .testTarget(
21 | name: "RDMUICManagerTests",
22 | dependencies: [
23 | "RDMUICManager"
24 | ]
25 | )
26 | ]
27 | )
28 |
--------------------------------------------------------------------------------
/Manager/Sources/RDMUICManager/BuildController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // BuildController.swift
3 | // RDM-UIC-Manager
4 | //
5 | // Created by Florian Kostenzer on 28.11.18.
6 | //
7 | // swiftlint:disable type_body_length function_body_length
8 | //
9 |
10 | import Foundation
11 | import PerfectLib
12 | import PerfectThread
13 |
14 | class BuildController {
15 |
16 | public static var global = BuildController()
17 |
18 | private var devicesLock = Threading.Lock()
19 | private var devicesToRemove = [Device]()
20 | private var devicesToAdd = [Device]()
21 |
22 | private var managerQueue: ThreadQueue!
23 |
24 | private var activeDeviceLock = Threading.Lock()
25 | private var activeDevices = [Device]()
26 |
27 | private var path: String = ""
28 | private var derivedDataPath: String = ""
29 | private var timeout: Int = 60
30 |
31 | private var maxSimultaneousBuilds: Int!
32 | private var buildLock = Threading.Lock()
33 | private var buildingCount = 0
34 |
35 | private var statuse = [String: String]()
36 | private var statusLock = Threading.Lock()
37 |
38 | private func setStatus(uuid: String, status: String) {
39 | statusLock.lock()
40 | statuse[uuid] = status
41 | statusLock.unlock()
42 | }
43 |
44 | public func getStatus(uuid: String) -> String? {
45 | statusLock.lock()
46 | let status = statuse[uuid]
47 | statusLock.unlock()
48 | return status
49 | }
50 |
51 | public func start(path: String, derivedDataPath: String, timeout: Int, maxSimultaneousBuilds: Int) {
52 |
53 | self.path = path
54 | self.timeout = timeout
55 | self.maxSimultaneousBuilds = maxSimultaneousBuilds
56 | self.derivedDataPath = derivedDataPath
57 |
58 | print("[INFO] Preparing DerivedDataPath")
59 | let derivedDataDir = Dir(derivedDataPath)
60 | if derivedDataDir.exists {
61 | try? derivedDataDir.forEachEntry { (name) in
62 | let dir = Dir(derivedDataDir.path + name)
63 | if dir.exists && dir.name != "Template" {
64 | let command = Shell("rm", "-rf", dir.path)
65 | _ = command.run(wait: true)
66 | }
67 | }
68 | }
69 |
70 | print("[INFO] Building Project...")
71 | Log.info(message: "Building Project...")
72 | let xcodebuild = Shell(
73 | "xcodebuild", "build-for-testing", "-workspace", "\(path)/RealDeviceMap-UIControl.xcworkspace",
74 | "-scheme", "RealDeviceMap-UIControl", "-destination", "generic/platform=iOS",
75 | "-derivedDataPath", "\(derivedDataDir.path)/Template"
76 | )
77 |
78 | let errorPipe = Pipe()
79 | let outputPipe = Pipe()
80 | _ = xcodebuild.run(outputPipe: outputPipe, errorPipe: errorPipe)
81 | let error = String(data: errorPipe.fileHandleForReading.readDataToEndOfFile(), encoding: .utf8) ?? ""
82 | let output = String(data: outputPipe.fileHandleForReading.readDataToEndOfFile(), encoding: .utf8) ?? ""
83 | if error.trimmingCharacters(in: .whitespacesAndNewlines) != "" {
84 |
85 | for line in error.components(separatedBy: "\n") {
86 | let trimmed = line.trimmingCharacters(in: .whitespacesAndNewlines)
87 | if trimmed != "" &&
88 | !trimmed.contains(string: "Using the first of multiple matching destinations") &&
89 | !trimmed.contains(string: "Generic iOS Device") &&
90 | !trimmed.contains(string: "DTDeviceKit: deviceType from") &&
91 | !trimmed.contains(string: "AssertMacros: amdErr = AMDeviceStartSession(tmpDevice) == 0") {
92 | Log.debug(message: "Abort triggered by line: \"\(trimmed)\"")
93 | Log.terminal(message: "Building Project Failed!\n\(output)\n\(error)")
94 | }
95 | }
96 |
97 | }
98 | print("[INFO] Building Project done")
99 | Log.info(message: "Building Project done")
100 |
101 | let derivedDataLogsDir = Dir("\(derivedDataDir.path)/Template/Logs")
102 | if derivedDataLogsDir.exists {
103 | let command = Shell("rm", "-rf", derivedDataLogsDir.path)
104 | _ = command.run(wait: true)
105 | }
106 |
107 | devicesLock.lock()
108 | devicesToAdd = Device.getAll()
109 | devicesLock.unlock()
110 | managerQueue = Threading.getQueue(name: "BuildController-Manager", type: .serial)
111 | managerQueue.dispatch(managerQueueRun)
112 | }
113 |
114 | public func addDevice(device: Device) {
115 | devicesLock.lock()
116 | devicesToAdd.append(device)
117 | devicesLock.unlock()
118 | }
119 |
120 | public func removeDevice(device: Device) {
121 | devicesLock.lock()
122 | devicesToRemove.append(device)
123 | devicesLock.unlock()
124 | }
125 |
126 | private func managerQueueRun() {
127 | while true {
128 | devicesLock.lock()
129 | let devicesToAdd = self.devicesToAdd
130 | let devicesToRemove = self.devicesToRemove
131 | self.devicesToAdd = [Device]()
132 | self.devicesToRemove = [Device]()
133 | devicesLock.unlock()
134 |
135 | for device in devicesToRemove {
136 | let queue = Threading.getQueue(name: "BuildController-\(device.uuid)", type: .serial)
137 | activeDeviceLock.lock()
138 | if let index = activeDevices.index(of: device) {
139 | activeDevices.remove(at: index)
140 | }
141 | activeDeviceLock.unlock()
142 | let derivedDataDir = Dir(self.derivedDataPath + "/\(device.uuid)")
143 | if derivedDataDir.exists {
144 | let command = Shell("rm", "-rf", derivedDataDir.path)
145 | _ = command.run(wait: true)
146 | }
147 |
148 | Threading.destroyQueue(queue)
149 | }
150 |
151 | for device in devicesToAdd {
152 | if device.enabled == 0 {
153 | self.setStatus(uuid: device.uuid, status: "Disabled")
154 | continue
155 | }
156 | let queue = Threading.getQueue(name: "BuildController-\(device.uuid)", type: .serial)
157 | activeDeviceLock.lock()
158 | activeDevices.append(device)
159 | activeDeviceLock.unlock()
160 | let derivedDataTemplateDir = self.derivedDataPath + "/Template/."
161 | let derivedDataDir = File(self.derivedDataPath + "/\(device.uuid)/")
162 | if derivedDataDir.exists {
163 | let command = Shell("rm", "-rf", derivedDataDir.path)
164 | _ = command.run(wait: true)
165 | }
166 | let command = Shell("cp", "-a", derivedDataTemplateDir, derivedDataDir.path)
167 | _ = command.run(wait: true)
168 |
169 | queue.dispatch {
170 | self.deviceQueueRun(device: device)
171 | }
172 | }
173 |
174 | Threading.sleep(seconds: 1)
175 | }
176 | }
177 |
178 | private func deviceQueueRun(device: Device) {
179 |
180 | Log.info(message: "Starting \(device.name)'s Manager")
181 |
182 | let derivedDataPath = self.derivedDataPath + "/" + device.uuid
183 |
184 | let xcodebuild = Shell(
185 | "xcodebuild", "test-without-building", "-workspace", "\(path)/RealDeviceMap-UIControl.xcworkspace",
186 | "-scheme", "RealDeviceMap-UIControl", "-destination", "id=\(device.uuid)",
187 | "-destination-timeout", "\(timeout * device.delayMultiplier)",
188 | "-derivedDataPath", derivedDataPath,
189 | "name=\(device.name)", "backendURL=\(device.backendURL)",
190 | "enableAccountManager=\(device.enableAccountManager)",
191 | "port=\(device.port)", "pokemonMaxTime=\(device.pokemonMaxTime)", "raidMaxTime=\(device.raidMaxTime)",
192 | "maxWarningTimeRaid=\(device.maxWarningTimeRaid)", "delayMultiplier=\(device.delayMultiplier)",
193 | "jitterValue=\(device.jitterValue)", "targetMaxDistance=\(device.targetMaxDistance)",
194 | "itemFullCount=\(device.itemFullCount)", "questFullCount=\(device.questFullCount)",
195 | "itemsPerStop=\(device.itemsPerStop)", "minDelayLogout=\(device.minDelayLogout)",
196 | "maxNoQuestCount=\(device.maxNoQuestCount)", "maxFailedCount=\(device.maxFailedCount)",
197 | "maxEmptyGMO=\(device.maxEmptyGMO)", "startupLocationLat=\(device.startupLocationLat)",
198 | "startupLocationLon=\(device.startupLocationLon)", "encounterMaxWait=\(device.encounterMaxWait)",
199 | "encounterDelay=\(device.encounterDelay)", "fastIV=\(device.fastIV)", "ultraIV=\(device.ultraIV)",
200 | "deployEggs=\(device.deployEggs)", "token=\(device.token)", "ultraQuests=\(device.ultraQuests)",
201 | "attachScreenshots=\(device.attachScreenshots)"
202 | )
203 |
204 | var contains = true
205 |
206 | let lastChangedLock = Threading.Lock()
207 | var lastChanged: Date?
208 |
209 | var task: Process?
210 | let xcodebuildQueue = Threading.getQueue(name: "BuildController-\(device.uuid)-runner", type: .serial)
211 | xcodebuildQueue.dispatch {
212 |
213 | var locked = false
214 |
215 | while contains {
216 | let outputPipe = Pipe()
217 | let errorPipe = Pipe()
218 |
219 | Log.debug(message: "[\(device.name)] Waiting for build lock...")
220 | self.setStatus(uuid: device.uuid, status: "Waiting for build")
221 | locked = true
222 | self.buildLock.lock()
223 | while self.buildingCount >= self.maxSimultaneousBuilds {
224 | self.buildLock.unlock()
225 | Threading.sleep(seconds: 1)
226 | self.buildLock.lock()
227 | }
228 | self.buildingCount += 1
229 | self.buildLock.unlock()
230 | lastChangedLock.lock()
231 | lastChanged = Date()
232 | lastChangedLock.unlock()
233 |
234 | Log.info(message: "[\(device.name)] Starting xcodebuild")
235 | self.setStatus(uuid: device.uuid, status: "Building")
236 |
237 | let timestamp = Int(Date().timeIntervalSince1970)
238 | let fullLog = FileLogger(file: "./logs/\(timestamp)-\(device.name)-xcodebuild.full.log")
239 | let debugLog = FileLogger(file: "./logs/\(timestamp)-\(device.name)-xcodebuild.debug.log")
240 |
241 | task = xcodebuild.run(outputPipe: outputPipe, errorPipe: errorPipe)
242 |
243 | outputPipe.fileHandleForReading.readabilityHandler = { fileHandle in
244 | let string = String(data: fileHandle.availableData, encoding: .utf8)
245 | if string != nil && string!.trimmingCharacters(in: .whitespacesAndNewlines) != "" {
246 | for line in string!.components(separatedBy: .newlines) {
247 | if line.contains(string: "[STATUS] Started") && locked {
248 | Log.debug(message: "[\(device.name)] Done building")
249 | self.setStatus(uuid: device.uuid, status: "Running: Starting")
250 | locked = false
251 | self.buildLock.lock()
252 | self.buildingCount -= 1
253 | self.buildLock.unlock()
254 | } else if line.starts(with: "[STATUS]") {
255 | self.setStatus(
256 | uuid: device.uuid,
257 | status: line.replacingOccurrences(of: "[STATUS] ", with: "")
258 | )
259 | }
260 | }
261 |
262 | fullLog.uic(message: string!, all: true)
263 | debugLog.uic(message: string!, all: false)
264 | lastChangedLock.lock()
265 | lastChanged = Date()
266 | lastChangedLock.unlock()
267 | }
268 | }
269 | errorPipe.fileHandleForReading.readabilityHandler = { fileHandle in
270 | let string = String(data: fileHandle.availableData, encoding: .utf8)
271 | if string != nil && string!.trimmingCharacters(in: .whitespacesAndNewlines) != "" {
272 | fullLog.uic(message: string!, all: true)
273 | debugLog.uic(message: string!, all: false)
274 | lastChangedLock.lock()
275 | lastChanged = Date()
276 | lastChangedLock.unlock()
277 | }
278 |
279 | }
280 | task?.waitUntilExit()
281 | errorPipe.fileHandleForReading.closeFile()
282 | outputPipe.fileHandleForReading.closeFile()
283 | Log.debug(message: "[\(device.name)] Xcodebuild ended")
284 | if locked {
285 | locked = false
286 | self.buildLock.lock()
287 | self.buildingCount -= 1
288 | self.buildLock.unlock()
289 | }
290 |
291 | lastChangedLock.lock()
292 | lastChanged = nil
293 | lastChangedLock.unlock()
294 | Threading.sleep(seconds: 1.0)
295 | }
296 | task?.suspend()
297 | }
298 |
299 | while contains {
300 |
301 | lastChangedLock.lock()
302 | if task != nil && lastChanged != nil &&
303 | Int(Date().timeIntervalSince(lastChanged!)) >= (timeout * device.delayMultiplier) {
304 | task!.terminate()
305 | Log.info(message:
306 | "[\(device.name)] Stopping xcodebuild. No output for over \(timeout * device.delayMultiplier)s")
307 | }
308 | lastChangedLock.unlock()
309 |
310 | Threading.sleep(seconds: 5.0)
311 | activeDeviceLock.lock()
312 | contains = activeDevices.contains(device)
313 | activeDeviceLock.unlock()
314 | }
315 | task?.terminate()
316 | Threading.destroyQueue(xcodebuildQueue)
317 | Log.info(message: "Stopping \(device.name)'s Manager")
318 | }
319 |
320 | }
321 |
--------------------------------------------------------------------------------
/Manager/Sources/RDMUICManager/CLI.swift:
--------------------------------------------------------------------------------
1 | //
2 | // CLI.swift
3 | // RDM-UIC-Manager
4 | //
5 | // Created by Florian Kostenzer on 27.11.18.
6 | //
7 | // swiftlint:disable file_length type_body_length function_body_length cyclomatic_complexity
8 | //
9 |
10 | import Foundation
11 | import PerfectThread
12 |
13 | internal extension Bool {
14 | func toInt() -> Int {
15 | if self {
16 | return 1
17 | }
18 | return 0
19 | }
20 | }
21 |
22 | internal extension Int {
23 | func toBool() -> Bool {
24 | if self == 1 {
25 | return true
26 | }
27 | return false
28 | }
29 | }
30 |
31 | class CLI {
32 |
33 | public static var global = CLI()
34 |
35 | private var defaultDevice: Device!
36 |
37 | // swiftlint:disable force_try
38 | public func start() {
39 | clear()
40 | let defaultDevice = Device.get(uuid: "default")
41 | if defaultDevice == nil {
42 | let defaultDevice = Device()
43 | print("Welcome to RealDeviceMap - UIControl - Manager")
44 | print("Please specify the default values for devices (or leave empty)")
45 | let backendURL = askInput("Default Backend URL")
46 | print("More Default Values can be changed in \"Edit Defaults\"")
47 | defaultDevice.uuid = "default"
48 | defaultDevice.name = "deafult"
49 | defaultDevice.backendURL = backendURL
50 | self.defaultDevice = defaultDevice
51 | try! self.defaultDevice!.create()
52 | print()
53 | } else {
54 | self.defaultDevice = defaultDevice!
55 | }
56 |
57 | while menu() {
58 | // Run untill menu() == false
59 | }
60 | }
61 | // swiftlint:enable force_try
62 |
63 | // MARK: - Menus
64 |
65 | public func menu() -> Bool {
66 |
67 | let menu = """
68 | ================
69 | MENU
70 | ================
71 | 1. Status
72 | 2. List All
73 | 3. Edit Defaults
74 | 4. Add Device
75 | 5. Edit Device
76 | 6. Delete Device
77 | 0. Exit
78 | ================
79 | """
80 |
81 | print(menu)
82 | let number = askInput("Please select an option", options: [0, 1, 2, 3, 4, 5, 6])
83 | print()
84 | switch number {
85 | case 1:
86 | status()
87 | return true
88 | case 2:
89 | listAll()
90 | return true
91 | case 3:
92 | editDefaults()
93 | return true
94 | case 4:
95 | addDevice()
96 | return true
97 | case 5:
98 | editDevice()
99 | return true
100 | case 6:
101 | deleteDevice()
102 | return true
103 | default:
104 | return false
105 | }
106 |
107 | }
108 |
109 | private func status() {
110 | clear()
111 | var run = true
112 | let queue = Threading.getQueue(name: "CLI-Status", type: .serial)
113 | queue.dispatch {
114 | while run {
115 | self.clear()
116 | let devices = Device.getAll()
117 | var rows = [[String]]()
118 | for device in devices {
119 | let status = BuildController.global.getStatus(uuid: device.uuid) ?? "?"
120 | rows.append([device.name, status])
121 | }
122 | self.printTable(headers: ["Name", "Status"], rows: rows)
123 | print("\nPress enter to exit...")
124 | Threading.sleep(seconds: 1)
125 | }
126 | }
127 |
128 | _ = readLine()
129 | run = false
130 | Threading.destroyQueue(queue)
131 | clear()
132 | }
133 |
134 | private func listAll() {
135 | clear()
136 | let devices = Device.getAll()
137 |
138 | for device in devices {
139 |
140 | clear()
141 | let row = """
142 | UUID: \(device.uuid)
143 | Name: \(device.name)
144 | Backend URL: \(device.backendURL)
145 | EnableAccountManager: \(device.enableAccountManager.toBool())
146 | Port: \(device.port)
147 | Pokemon Max Time: \(device.pokemonMaxTime)
148 | Raid Max Time: \(device.raidMaxTime)
149 | Max Warning Time Raid: \(device.maxWarningTimeRaid)
150 | Delay Multiplier: \(device.delayMultiplier)
151 | Jitter Value: \(device.jitterValue)
152 | Target Max Distance: \(device.targetMaxDistance)
153 | Item Full Count: \(device.itemFullCount)
154 | Quest Full Count: \(device.questFullCount)
155 | Items Per Stop: \(device.itemsPerStop)
156 | Min Delay Logout: \(device.minDelayLogout)
157 | Max NoQuest Count: \(device.maxNoQuestCount)
158 | Max Failed Count: \(device.maxFailedCount)
159 | Max Empty GMO: \(device.maxEmptyGMO)
160 | Startup Location Lat: \(device.startupLocationLat)
161 | Startup Location Lon: \(device.startupLocationLon)
162 | Encounter Max Wait: \(device.encounterMaxWait)
163 | Encounter Delay: \(device.encounterDelay)
164 | Fast IV: \(device.fastIV.toBool())
165 | Ultra IV: \(device.ultraIV.toBool())
166 | deployEggs: \(device.deployEggs.toBool())
167 | token: \(device.token)
168 | Ultra Quests: \(device.ultraQuests.toBool())
169 | Enabled: \(device.enabled.toBool())
170 | AttachScreenshots: \(device.attachScreenshots.toBool())
171 | """
172 |
173 | print(row + "\n")
174 | print("Press enter to continue...")
175 | _ = readLine()
176 | }
177 | clear()
178 | }
179 |
180 | private func editDefaults() {
181 | clear()
182 | print("Edit Defaults\n")
183 | let backendURL = askInput("Default Backend URL (empty = \(defaultDevice.backendURL))")
184 | if backendURL != "" {
185 | defaultDevice.backendURL = backendURL
186 | }
187 |
188 | let enableAccountManager = askBool(
189 | "Enable Account Manager (empty = \(defaultDevice.enableAccountManager.toBool()))"
190 | )
191 | if enableAccountManager != nil {
192 | defaultDevice.enableAccountManager = enableAccountManager!.toInt()
193 | }
194 |
195 | let port = askInt("Port (empty = \(defaultDevice.port))")
196 | if port != nil {
197 | defaultDevice.port = port!
198 | }
199 |
200 | let pokemonMaxTime = askDouble("Pokemon Max Time (empty = \(defaultDevice.pokemonMaxTime))")
201 | if pokemonMaxTime != nil {
202 | defaultDevice.pokemonMaxTime = pokemonMaxTime!
203 | }
204 |
205 | let raidMaxTime = askDouble("Raid Max Time (empty = \(defaultDevice.raidMaxTime))")
206 | if raidMaxTime != nil {
207 | defaultDevice.raidMaxTime = raidMaxTime!
208 | }
209 |
210 | let maxWarningTimeRaid = askInt("Max Warning Time Raid (empty = \(defaultDevice.maxWarningTimeRaid))")
211 | if maxWarningTimeRaid != nil {
212 | defaultDevice.maxWarningTimeRaid = maxWarningTimeRaid!
213 | }
214 |
215 | let delayMultiplier = askInt("Delay Multiplier (empty = \(defaultDevice.delayMultiplier))")
216 | if delayMultiplier != nil {
217 | defaultDevice.delayMultiplier = delayMultiplier!
218 | }
219 |
220 | let jitterValue = askDouble("Jitter Value (empty = \(defaultDevice.jitterValue))")
221 | if jitterValue != nil {
222 | defaultDevice.jitterValue = jitterValue!
223 | }
224 |
225 | let targetMaxDistance = askDouble("Target Max Distance (empty = \(defaultDevice.targetMaxDistance))")
226 | if targetMaxDistance != nil {
227 | defaultDevice.targetMaxDistance = targetMaxDistance!
228 | }
229 |
230 | let itemFullCount = askInt("Item Full Count (empty = \(defaultDevice.itemFullCount))")
231 | if itemFullCount != nil {
232 | defaultDevice.itemFullCount = itemFullCount!
233 | }
234 |
235 | let questFullCount = askInt("Quest Full Count (empty = \(defaultDevice.questFullCount))")
236 | if questFullCount != nil {
237 | defaultDevice.questFullCount = questFullCount!
238 | }
239 |
240 | let itemsPerStop = askInt("Items Per Stop (empty = \(defaultDevice.itemsPerStop))")
241 | if itemsPerStop != nil {
242 | defaultDevice.itemsPerStop = itemsPerStop!
243 | }
244 |
245 | let minDelayLogout = askDouble("Min Delay Logout (empty = \(defaultDevice.minDelayLogout))")
246 | if minDelayLogout != nil {
247 | defaultDevice.minDelayLogout = minDelayLogout!
248 | }
249 |
250 | let maxNoQuestCount = askInt("Max No Quest Count (empty = \(defaultDevice.maxNoQuestCount))")
251 | if maxNoQuestCount != nil {
252 | defaultDevice.maxNoQuestCount = maxNoQuestCount!
253 | }
254 |
255 | let maxFailedCount = askInt("Max Failed Count (empty = \(defaultDevice.maxFailedCount))")
256 | if maxFailedCount != nil {
257 | defaultDevice.maxFailedCount = maxFailedCount!
258 | }
259 |
260 | let maxEmptyGMO = askInt("Max Empty GMO (empty = \(defaultDevice.maxEmptyGMO))")
261 | if maxEmptyGMO != nil {
262 | defaultDevice.maxEmptyGMO = maxEmptyGMO!
263 | }
264 |
265 | let startupLocationLat = askDouble("Startup Location Lat (empty = \(defaultDevice.startupLocationLat))")
266 | if startupLocationLat != nil {
267 | defaultDevice.startupLocationLat = startupLocationLat!
268 | }
269 |
270 | let startupLocationLon = askDouble("Startup Location Lon (empty = \(defaultDevice.startupLocationLon))")
271 | if startupLocationLon != nil {
272 | defaultDevice.startupLocationLon = startupLocationLon!
273 | }
274 |
275 | let encounterMaxWait = askInt("Encounter Max Wait (empty = \(defaultDevice.encounterMaxWait))")
276 | if encounterMaxWait != nil {
277 | defaultDevice.encounterMaxWait = encounterMaxWait!
278 | }
279 |
280 | let encounterDelay = askDouble("Encounter Delay (empty = \(defaultDevice.encounterDelay))")
281 | if encounterDelay != nil {
282 | defaultDevice.encounterDelay = encounterDelay!
283 | }
284 |
285 | let fastIV = askBool("Fast IV (empty = \(defaultDevice.fastIV.toBool()))")
286 | if fastIV != nil {
287 | defaultDevice.fastIV = fastIV!.toInt()
288 | }
289 |
290 | let ultraIV = askBool("Ultra IV (empty = \(defaultDevice.ultraIV.toBool()))")
291 | if ultraIV != nil {
292 | defaultDevice.ultraIV = ultraIV!.toInt()
293 | }
294 |
295 | let deployEggs = askBool("Deploy Eggs (empy = \(defaultDevice.deployEggs.toBool()))")
296 | if deployEggs != nil {
297 | defaultDevice.deployEggs = deployEggs!.toInt()
298 | }
299 |
300 | let ultraQuests = askBool("Ultra Quests (empty = \(defaultDevice.ultraQuests.toBool()))")
301 | if ultraQuests != nil {
302 | defaultDevice.ultraQuests = ultraQuests!.toInt()
303 | }
304 |
305 | let token = askInput("Token (empy = \(defaultDevice.token))")
306 | if token != "" {
307 | defaultDevice.token = token
308 | }
309 |
310 | let enabled = askBool("Enabled (empty = \(defaultDevice.enabled.toBool()))")
311 | if enabled != nil {
312 | defaultDevice.enabled = enabled!.toInt()
313 | }
314 |
315 | let attachScreenshots = askBool("Attach Screenshots (empty = \(defaultDevice.attachScreenshots.toBool()))")
316 | if attachScreenshots != nil {
317 | defaultDevice.attachScreenshots = attachScreenshots!.toInt()
318 | }
319 |
320 | do {
321 | try defaultDevice.save()
322 | clear()
323 | print("Defaults updated.\n\n")
324 | } catch {
325 | print("Failed to update defaults.\n\n")
326 | }
327 | }
328 |
329 | private func addDevice() {
330 | clear()
331 | print("Add Device\n")
332 | let device = Device()
333 | let uuid = askInput("Device UUID (empty to cancel)")
334 | if uuid == "" {
335 | clear()
336 | return
337 | }
338 | let name = askInput("Device Name")
339 | var backendURL = askInput("Backend URL (empty = \(defaultDevice.backendURL))")
340 | if backendURL == "" {
341 | backendURL = defaultDevice.backendURL
342 | }
343 | var enableAccountManager = askBool(
344 | "Enable Account Manager (empty = \(defaultDevice.enableAccountManager.toBool()))"
345 | )?.toInt()
346 | if enableAccountManager == nil {
347 | enableAccountManager = defaultDevice.enableAccountManager
348 | }
349 |
350 | var port = askInt("Port (empty = \(defaultDevice.port))")
351 | if port == nil {
352 | port = defaultDevice.port
353 | }
354 |
355 | var pokemonMaxTime = askDouble("Pokemon Max Time (empty = \(defaultDevice.pokemonMaxTime))")
356 | if pokemonMaxTime == nil {
357 | pokemonMaxTime = defaultDevice.pokemonMaxTime
358 | }
359 |
360 | var raidMaxTime = askDouble("Raid Max Time (empty = \(defaultDevice.raidMaxTime))")
361 | if raidMaxTime == nil {
362 | raidMaxTime = defaultDevice.raidMaxTime
363 | }
364 |
365 | var maxWarningTimeRaid = askInt("Max Warning Time Raid (empty = \(defaultDevice.maxWarningTimeRaid))")
366 | if maxWarningTimeRaid == nil {
367 | maxWarningTimeRaid = defaultDevice.maxWarningTimeRaid
368 | }
369 |
370 | var delayMultiplier = askInt("Delay Multiplier (empty = \(defaultDevice.delayMultiplier))")
371 | if delayMultiplier == nil {
372 | delayMultiplier = defaultDevice.delayMultiplier
373 | }
374 |
375 | var jitterValue = askDouble("Jitter Value (empty = \(defaultDevice.jitterValue))")
376 | if jitterValue == nil {
377 | jitterValue = defaultDevice.jitterValue
378 | }
379 |
380 | var targetMaxDistance = askDouble("Target Max Distance (empty = \(defaultDevice.targetMaxDistance))")
381 | if targetMaxDistance == nil {
382 | targetMaxDistance = defaultDevice.targetMaxDistance
383 | }
384 |
385 | var itemFullCount = askInt("Item Full Count (empty = \(defaultDevice.itemFullCount))")
386 | if itemFullCount == nil {
387 | itemFullCount = defaultDevice.itemFullCount
388 | }
389 |
390 | var questFullCount = askInt("Quest Full Count (empty = \(defaultDevice.questFullCount))")
391 | if questFullCount == nil {
392 | questFullCount = defaultDevice.questFullCount
393 | }
394 |
395 | var itemsPerStop = askInt("Items Per Stop (empty = \(defaultDevice.itemsPerStop))")
396 | if itemsPerStop == nil {
397 | itemsPerStop = defaultDevice.itemsPerStop
398 | }
399 |
400 | var minDelayLogout = askDouble("Min Delay Logout (empty = \(defaultDevice.minDelayLogout))")
401 | if minDelayLogout == nil {
402 | minDelayLogout = defaultDevice.minDelayLogout
403 | }
404 |
405 | var maxNoQuestCount = askInt("Max No Quest Count (empty = \(defaultDevice.maxNoQuestCount))")
406 | if maxNoQuestCount == nil {
407 | maxNoQuestCount = defaultDevice.maxNoQuestCount
408 | }
409 |
410 | var maxFailedCount = askInt("Max Failed Count (empty = \(defaultDevice.maxFailedCount))")
411 | if maxFailedCount == nil {
412 | maxFailedCount = defaultDevice.maxFailedCount
413 | }
414 |
415 | var maxEmptyGMO = askInt("Max Empty GMO (empty = \(defaultDevice.maxEmptyGMO))")
416 | if maxEmptyGMO == nil {
417 | maxEmptyGMO = defaultDevice.maxEmptyGMO
418 | }
419 |
420 | var startupLocationLat = askDouble("Startup Location Lat (empty = \(defaultDevice.startupLocationLat))")
421 | if startupLocationLat == nil {
422 | startupLocationLat = defaultDevice.startupLocationLat
423 | }
424 |
425 | var startupLocationLon = askDouble("Startup Location Lon (empty = \(defaultDevice.startupLocationLon))")
426 | if startupLocationLon == nil {
427 | startupLocationLon = defaultDevice.startupLocationLon
428 | }
429 |
430 | var encounterMaxWait = askInt("Encounter Max Wait (empty = \(defaultDevice.encounterMaxWait))")
431 | if encounterMaxWait == nil {
432 | encounterMaxWait = defaultDevice.encounterMaxWait
433 | }
434 |
435 | var encounterDelay = askDouble("Encounter Delay (empty = \(defaultDevice.encounterDelay))")
436 | if encounterDelay == nil {
437 | encounterDelay = defaultDevice.encounterDelay
438 | }
439 | var fastIV = askBool("Fast IV (empty = \(defaultDevice.fastIV.toBool()))")?.toInt()
440 | if fastIV == nil {
441 | fastIV = defaultDevice.fastIV
442 | }
443 |
444 | var ultraIV = askBool("Ultra IV (empty = \(defaultDevice.ultraIV.toBool()))")?.toInt()
445 | if ultraIV == nil {
446 | ultraIV = defaultDevice.ultraIV
447 | }
448 |
449 | var deployEggs = askBool("Deploy Eggs (empty = \(defaultDevice.deployEggs.toBool()))")?.toInt()
450 | if deployEggs == nil {
451 | deployEggs = defaultDevice.deployEggs
452 | }
453 |
454 | var token = askInput("Token (empy = \(defaultDevice.token))")
455 | if token == "" {
456 | token = defaultDevice.token
457 | }
458 |
459 | var ultraQuests = askBool("Ultra Quests (empty = \(defaultDevice.ultraQuests.toBool()))")?.toInt()
460 | if ultraQuests == nil {
461 | ultraQuests = defaultDevice.ultraQuests
462 | }
463 |
464 | var enabled = askBool("Enabled (empty = \(defaultDevice.enabled.toBool()))")?.toInt()
465 | if enabled == nil {
466 | enabled = defaultDevice.enabled
467 | }
468 |
469 | var attachScreenshots = askBool(
470 | "Attach Screenshots (empty = \(defaultDevice.attachScreenshots.toBool()))"
471 | )?.toInt()
472 | if attachScreenshots == nil {
473 | attachScreenshots = defaultDevice.attachScreenshots
474 | }
475 |
476 | device.uuid = uuid
477 | device.name = name
478 | device.backendURL = backendURL
479 | device.enableAccountManager = enableAccountManager!
480 | device.port = port!
481 | device.pokemonMaxTime = pokemonMaxTime!
482 | device.raidMaxTime = raidMaxTime!
483 | device.maxWarningTimeRaid = maxWarningTimeRaid!
484 | device.delayMultiplier = delayMultiplier!
485 | device.jitterValue = jitterValue!
486 | device.targetMaxDistance = targetMaxDistance!
487 | device.itemFullCount = itemFullCount!
488 | device.questFullCount = questFullCount!
489 | device.itemsPerStop = itemsPerStop!
490 | device.minDelayLogout = minDelayLogout!
491 | device.maxNoQuestCount = maxNoQuestCount!
492 | device.maxFailedCount = maxFailedCount!
493 | device.maxEmptyGMO = maxEmptyGMO!
494 | device.startupLocationLat = startupLocationLat!
495 | device.startupLocationLon = startupLocationLon!
496 | device.encounterMaxWait = encounterMaxWait!
497 | device.encounterDelay = encounterDelay!
498 | device.fastIV = fastIV!
499 | device.ultraIV = ultraIV!
500 | device.deployEggs = deployEggs!
501 | device.token = token
502 | device.ultraQuests = ultraQuests!
503 | device.enabled = enabled!
504 | device.attachScreenshots = attachScreenshots!
505 |
506 | do {
507 | try device.create()
508 | clear()
509 | BuildController.global.addDevice(device: device)
510 | print("Device added.\n\n")
511 | } catch {
512 | print("Failed to add device.\n\n")
513 | }
514 |
515 | }
516 |
517 | private func editDevice() {
518 | clear()
519 | let devices = Device.getAll()
520 | print("=====================")
521 | print("Select Device to Edit")
522 | print("=====================")
523 | var i = 1
524 | for device in devices {
525 | print("\(i): \(device.name)")
526 | i += 1
527 | }
528 | print("0: Back")
529 | print("=====================")
530 | let index = askInput("Please select an option", options: Array(0...devices.count))
531 | print()
532 | if index == 0 {
533 | clear()
534 | return
535 | }
536 | let device = devices[index - 1]
537 |
538 | let name = askInput("Device Name (empty = \(device.name))")
539 | if name != "" {
540 | device.name = name
541 | }
542 | let backendURL = askInput("Backend URL (empty = \(device.backendURL))")
543 | if backendURL != "" {
544 | device.backendURL = backendURL
545 | }
546 |
547 | let enableAccountManager = askBool("Enable Account Manager (empty = \(device.enableAccountManager.toBool()))")
548 | if enableAccountManager != nil {
549 | device.enableAccountManager = enableAccountManager!.toInt()
550 | }
551 |
552 | let port = askInt("Port (empty = \(device.port))")
553 | if port != nil {
554 | device.port = port!
555 | }
556 |
557 | let pokemonMaxTime = askDouble("Pokemon Max Time (empty = \(device.pokemonMaxTime))")
558 | if pokemonMaxTime != nil {
559 | device.pokemonMaxTime = pokemonMaxTime!
560 | }
561 |
562 | let raidMaxTime = askDouble("Raid Max Time (empty = \(device.raidMaxTime))")
563 | if raidMaxTime != nil {
564 | device.raidMaxTime = raidMaxTime!
565 | }
566 |
567 | let maxWarningTimeRaid = askInt("Max Warning Time Raid (empty = \(device.maxWarningTimeRaid))")
568 | if maxWarningTimeRaid != nil {
569 | device.maxWarningTimeRaid = maxWarningTimeRaid!
570 | }
571 |
572 | let delayMultiplier = askInt("Delay Multiplier (empty = \(device.delayMultiplier))")
573 | if delayMultiplier != nil {
574 | device.delayMultiplier = delayMultiplier!
575 | }
576 |
577 | let jitterValue = askDouble("Jitter Value (empty = \(device.jitterValue))")
578 | if jitterValue != nil {
579 | device.jitterValue = jitterValue!
580 | }
581 |
582 | let targetMaxDistance = askDouble("Target Max Distance (empty = \(device.targetMaxDistance))")
583 | if targetMaxDistance != nil {
584 | device.targetMaxDistance = targetMaxDistance!
585 | }
586 |
587 | let itemFullCount = askInt("Item Full Count (empty = \(device.itemFullCount))")
588 | if itemFullCount != nil {
589 | device.itemFullCount = itemFullCount!
590 | }
591 |
592 | let questFullCount = askInt("Quest Full Count (empty = \(device.questFullCount))")
593 | if questFullCount != nil {
594 | device.questFullCount = questFullCount!
595 | }
596 |
597 | let itemsPerStop = askInt("Items Per Stop (empty = \(device.itemsPerStop))")
598 | if itemsPerStop != nil {
599 | device.itemsPerStop = itemsPerStop!
600 | }
601 |
602 | let minDelayLogout = askDouble("Min Delay Logout (empty = \(device.minDelayLogout))")
603 | if minDelayLogout != nil {
604 | device.minDelayLogout = minDelayLogout!
605 | }
606 |
607 | let maxNoQuestCount = askInt("Max No Quest Count (empty = \(device.maxNoQuestCount))")
608 | if maxNoQuestCount != nil {
609 | device.maxNoQuestCount = maxNoQuestCount!
610 | }
611 |
612 | let maxFailedCount = askInt("Max Failed Count (empty = \(device.maxFailedCount))")
613 | if maxFailedCount != nil {
614 | device.maxFailedCount = maxFailedCount!
615 | }
616 |
617 | let maxEmptyGMO = askInt("Max Empty GMO (empty = \(device.maxEmptyGMO))")
618 | if maxEmptyGMO != nil {
619 | device.maxEmptyGMO = maxEmptyGMO!
620 | }
621 |
622 | let startupLocationLat = askDouble("Startup Location Lat (empty = \(device.startupLocationLat))")
623 | if startupLocationLat != nil {
624 | device.startupLocationLat = startupLocationLat!
625 | }
626 |
627 | let startupLocationLon = askDouble("Startup Location Lon (empty = \(device.startupLocationLon))")
628 | if startupLocationLon != nil {
629 | device.startupLocationLon = startupLocationLon!
630 | }
631 |
632 | let encounterMaxWait = askInt("Encounter Max Wait (empty = \(device.encounterMaxWait))")
633 | if encounterMaxWait != nil {
634 | device.encounterMaxWait = encounterMaxWait!
635 | }
636 |
637 | let encounterDelay = askDouble("Encounter Delay (empty = \(device.encounterDelay))")
638 | if encounterDelay != nil {
639 | device.encounterDelay = encounterDelay!
640 | }
641 |
642 | let fastIV = askBool("Fast IV (empty = \(device.fastIV.toBool()))")
643 | if fastIV != nil {
644 | device.fastIV = fastIV!.toInt()
645 | }
646 |
647 | let ultraIV = askBool("Ultra IV (empty = \(device.ultraIV.toBool()))")
648 | if ultraIV != nil {
649 | device.ultraIV = ultraIV!.toInt()
650 | }
651 |
652 | let deployEggs = askBool("Deploy Eggs (empty = \(device.deployEggs.toBool()))")
653 | if deployEggs != nil {
654 | device.deployEggs = deployEggs!.toInt()
655 | }
656 |
657 | let token = askInput("Token (empy = \(defaultDevice.token))")
658 | if token != "" {
659 | device.token = token
660 | }
661 |
662 | let ultraQuests = askBool("Ultra Quests (empty = \(device.ultraQuests.toBool()))")
663 | if ultraQuests != nil {
664 | device.ultraQuests = ultraQuests!.toInt()
665 | }
666 |
667 | let enabled = askBool("Enabled (empty = \(device.enabled.toBool()))")
668 | if enabled != nil {
669 | device.enabled = enabled!.toInt()
670 | }
671 |
672 | let attachScreenshots = askBool("Attach Screenshots (empty = \(device.attachScreenshots.toBool()))")
673 | if attachScreenshots != nil {
674 | device.attachScreenshots = attachScreenshots!.toInt()
675 | }
676 |
677 | do {
678 | try device.save()
679 | clear()
680 | BuildController.global.removeDevice(device: device)
681 | let tmpQueue = Threading.getQueue(name: UUID().uuidString, type: .serial)
682 | tmpQueue.dispatch {
683 | Threading.sleep(seconds: 10.0)
684 | BuildController.global.addDevice(device: device)
685 | Threading.destroyQueue(tmpQueue)
686 | }
687 | print("Device updated.\n\n")
688 | } catch {
689 | print("Failed to update device.\n\n")
690 | }
691 | }
692 |
693 | private func deleteDevice() {
694 | clear()
695 | let devices = Device.getAll()
696 | print("=======================")
697 | print("Select Device to Delete")
698 | print("=======================")
699 | var i = 1
700 | for device in devices {
701 | print("\(i): \(device.name)")
702 | i += 1
703 | }
704 | print("0: Back")
705 | print("=====================")
706 | let index = askInput("Please select an option", options: Array(0...devices.count))
707 | print()
708 | if index == 0 {
709 | clear()
710 | return
711 | }
712 | let device = devices[index - 1]
713 | do {
714 | try device.delete()
715 | clear()
716 | BuildController.global.removeDevice(device: device)
717 | print("Device deleted.\n\n")
718 | } catch {
719 | print("Failed to delete device.\n\n")
720 | }
721 | }
722 |
723 | // MARK: - Helper Functions
724 |
725 | private func askInput(_ line: String) -> String {
726 | print("\(line): ", terminator: "")
727 | return (readLine() ?? "").trimmingCharacters(in: .whitespacesAndNewlines)
728 | }
729 |
730 | private func askBool(_ line: String) -> Bool? {
731 | let input = askInput(line)
732 | if input == "" {
733 | return nil
734 | }
735 | guard let bool = Bool(input) else {
736 | print("Please enter \"true\", \"false\" or nothing")
737 | return askBool(line)
738 | }
739 | return bool
740 | }
741 |
742 | private func askDouble(_ line: String) -> Double? {
743 | let input = askInput(line)
744 | if input == "" {
745 | return nil
746 | }
747 | guard let double = Double(input) else {
748 | print("Please enter a valid double or nothing")
749 | return askDouble(line)
750 | }
751 | return double
752 | }
753 |
754 | private func askInt(_ line: String) -> Int? {
755 | let input = askInput(line)
756 | if input == "" {
757 | return nil
758 | }
759 | guard let int = Int(input) else {
760 | print("Please enter integer nothing")
761 | return askInt(line)
762 | }
763 | return int
764 | }
765 |
766 | private func askInput(_ line: String, options: [Int]) -> Int {
767 | let input = askInput(line)
768 | if let option = Int(input), options.contains(option) {
769 | return option
770 | } else {
771 | print("Please select an valid option.")
772 | return askInput(line, options: options)
773 | }
774 | }
775 |
776 | private func printTable(headers: [String], rows: [[String]]) {
777 | var table = [String: [String]]()
778 | for header in headers {
779 | table[header] = [String]()
780 | }
781 |
782 | for row in rows {
783 | var i = 0
784 | for header in headers {
785 | table[header]!.append(row[i])
786 | i += 1
787 | }
788 |
789 | }
790 | var tableSorted = [(header: String, rows: [String])]()
791 | for header in headers {
792 | if let column = table.first(where: { (column) -> Bool in
793 | return column.key == header
794 | }) {
795 | tableSorted.append((header: header, rows: column.value))
796 | }
797 | }
798 |
799 | printTable(tableSorted)
800 | }
801 |
802 | private func printTable(_ table: [(header: String, rows: [String])]) {
803 |
804 | var columnSizes = [Int]()
805 | for column in table {
806 | var maxSize = 0
807 | if column.header.count > maxSize {
808 | maxSize = column.header.count
809 | }
810 | for row in column.rows where row.count > maxSize {
811 | maxSize = row.count
812 | }
813 | columnSizes.append(maxSize)
814 | }
815 |
816 | var rows = [String]()
817 | var x = 0
818 | for column in table {
819 | if x == 0 {
820 | rows.append("")
821 | rows.append("")
822 | }
823 | rows[0] += getPrintFill(column.header, toCount: columnSizes[x], with: " ")
824 | rows[1] += getPrintFill("", toCount: columnSizes[x], with: "=")
825 | if x < table.count - 1 {
826 | rows[0] += "|"
827 | rows[1] += "|"
828 | }
829 | var i = 2
830 | for row in column.rows {
831 | if x == 0 {
832 | rows.append("")
833 | }
834 | rows[i] += getPrintFill(row, toCount: columnSizes[x], with: " ")
835 | if x < table.count - 1 {
836 | rows[i] += "|"
837 | }
838 | i += 1
839 | }
840 | x += 1
841 | }
842 | for row in rows {
843 | print(row)
844 | }
845 | print("\n")
846 | }
847 |
848 | private func getPrintFill(_ text: String, toCount: Int, with: Character) -> String {
849 | var row = text
850 | while row.count < toCount {
851 | row.append(with)
852 | }
853 | return row
854 | }
855 |
856 | private func clear() {
857 | print("\u{001B}[2J")
858 | }
859 | }
860 |
--------------------------------------------------------------------------------
/Manager/Sources/RDMUICManager/Device.swift:
--------------------------------------------------------------------------------
1 | //
2 | // DeviceConfig.swift
3 | // RDM-UIC-Manager
4 | //
5 | // Created by Florian Kostenzer on 27.11.18.
6 | //
7 | // swiftlint:disable type_body_length function_body_length cyclomatic_complexity
8 | //
9 |
10 | import Foundation
11 | import StORM
12 | import SQLiteStORM
13 | import PerfectLib
14 |
15 | class Device: SQLiteStORM, Equatable, Hashable {
16 |
17 | #if swift(>=4.2)
18 | public func hash(into hasher: inout Hasher) {
19 | hasher.combine(uuid)
20 | }
21 | #else
22 | public var hashValue: Int {
23 | return uuid.hashValue
24 | }
25 | #endif
26 |
27 | var uuid: String
28 | var name: String
29 | var backendURL: String
30 | var enableAccountManager: Int
31 | var port: Int
32 | var pokemonMaxTime: Double
33 | var raidMaxTime: Double
34 | var maxWarningTimeRaid: Int
35 | var delayMultiplier: Int
36 | var jitterValue: Double
37 | var targetMaxDistance: Double
38 | var itemFullCount: Int
39 | var questFullCount: Int
40 | var itemsPerStop: Int
41 | var minDelayLogout: Double
42 | var maxNoQuestCount: Int
43 | var maxFailedCount: Int
44 | var maxEmptyGMO: Int
45 | var startupLocationLat: Double
46 | var startupLocationLon: Double
47 | var encounterMaxWait: Int
48 | var encounterDelay: Double
49 | var fastIV: Int
50 | var ultraIV: Int
51 | var deployEggs: Int
52 | var token: String
53 | var ultraQuests: Int
54 | var enabled: Int
55 | var attachScreenshots: Int
56 |
57 | override init() {
58 | self.uuid = ""
59 | self.name = ""
60 | self.backendURL = ""
61 | self.enableAccountManager = 0
62 | self.port = 8080
63 | self.pokemonMaxTime = 45.0
64 | self.raidMaxTime = 25.0
65 | self.maxWarningTimeRaid = 432000
66 | self.delayMultiplier = 1
67 | self.jitterValue = 0.00005
68 | self.targetMaxDistance = 250.0
69 | self.itemFullCount = 250
70 | self.questFullCount = 3
71 | self.itemsPerStop = 10
72 | self.minDelayLogout = 180
73 | self.maxNoQuestCount = 5
74 | self.maxFailedCount = 5
75 | self.maxEmptyGMO = 5
76 | self.startupLocationLat = 1
77 | self.startupLocationLon = 1
78 | self.encounterMaxWait = 7
79 | self.encounterDelay = 1.0
80 | self.fastIV = 0
81 | self.ultraIV = 0
82 | self.deployEggs = 0
83 | self.token = ""
84 | self.ultraQuests = 0
85 | self.enabled = 1
86 | self.attachScreenshots = 0
87 | super.init()
88 | }
89 |
90 | init(uuid: String, name: String, backendURL: String, enableAccountManager: Int, port: Int, pokemonMaxTime: Double,
91 | raidMaxTime: Double, maxWarningTimeRaid: Int, delayMultiplier: Int, jitterValue: Double,
92 | targetMaxDistance: Double, itemFullCount: Int, questFullCount: Int, itemsPerStop: Int, minDelayLogout: Double,
93 | maxNoQuestCount: Int, maxFailedCount: Int, maxEmptyGMO: Int, startupLocationLat: Double,
94 | startupLocationLon: Double, encounterMaxWait: Int, encounterDelay: Double, fastIV: Int, ultraIV: Int,
95 | deployEggs: Int, token: String, ultraQuests: Int, enabled: Int, attachScreenshots: Int) {
96 | self.uuid = uuid
97 | self.name = name
98 | self.backendURL = backendURL
99 | self.enableAccountManager = enableAccountManager
100 | self.port = port
101 | self.pokemonMaxTime = pokemonMaxTime
102 | self.raidMaxTime = raidMaxTime
103 | self.maxWarningTimeRaid = maxWarningTimeRaid
104 | self.delayMultiplier = delayMultiplier
105 | self.jitterValue = jitterValue
106 | self.targetMaxDistance = targetMaxDistance
107 | self.itemFullCount = itemFullCount
108 | self.questFullCount = questFullCount
109 | self.itemsPerStop = itemsPerStop
110 | self.minDelayLogout = minDelayLogout
111 | self.maxNoQuestCount = maxNoQuestCount
112 | self.maxFailedCount = maxFailedCount
113 | self.maxEmptyGMO = maxEmptyGMO
114 | self.startupLocationLat = startupLocationLat
115 | self.startupLocationLon = startupLocationLon
116 | self.encounterMaxWait = encounterMaxWait
117 | self.encounterDelay = encounterDelay
118 | self.fastIV = fastIV
119 | self.ultraIV = ultraIV
120 | self.deployEggs = deployEggs
121 | self.token = token
122 | self.ultraQuests = ultraQuests
123 | self.enabled = enabled
124 | self.attachScreenshots = attachScreenshots
125 | super.init()
126 | }
127 |
128 | override open func table() -> String {
129 | return "device"
130 | }
131 |
132 | override func to(_ this: StORMRow) {
133 | uuid = this.data["uuid"] as? String ?? ""
134 | name = this.data["name"] as? String ?? ""
135 | backendURL = this.data["backendURL"] as? String ?? ""
136 | enableAccountManager = this.data["enableAccountManager"] as? Int ?? 0
137 | port = this.data["port"] as? Int ?? 8080
138 | pokemonMaxTime = this.data["pokemonMaxTime"] as? Double ?? 45.0
139 | raidMaxTime = this.data["raidMaxTime"] as? Double ?? 25.0
140 | maxWarningTimeRaid = this.data["maxWarningTimeRaid"] as? Int ?? 432000
141 | delayMultiplier = this.data["delayMultiplier"] as? Int ?? 1
142 | jitterValue = this.data["jitterValue"] as? Double ?? 0.00005
143 | targetMaxDistance = this.data["targetMaxDistance"] as? Double ?? 250.0
144 | itemFullCount = this.data["itemFullCount"] as? Int ?? 250
145 | questFullCount = this.data["questFullCount"] as? Int ?? 3
146 | itemsPerStop = this.data["itemsPerStop"] as? Int ?? 10
147 | minDelayLogout = this.data["minDelayLogout"] as? Double ?? 180
148 | maxNoQuestCount = this.data["maxNoQuestCount"] as? Int ?? 5
149 | maxFailedCount = this.data["maxFailedCount"] as? Int ?? 5
150 | maxEmptyGMO = this.data["maxEmptyGMO"] as? Int ?? 5
151 | startupLocationLat = this.data["startupLocationLat"] as? Double ?? 1
152 | startupLocationLon = this.data["startupLocationLon"] as? Double ?? 1
153 | encounterMaxWait = this.data["encounterMaxWait"] as? Int ?? 7
154 | encounterDelay = this.data["encounterDelay"] as? Double ?? 1.0
155 | fastIV = this.data["fastIV"] as? Int ?? 0
156 | ultraIV = this.data["ultraIV"] as? Int ?? 0
157 | deployEggs = this.data["deployEggs"] as? Int ?? 0
158 | token = this.data["token"] as? String ?? ""
159 | ultraQuests = this.data["ultraQuests"] as? Int ?? 0
160 | enabled = this.data["enabled"] as? Int ?? 1
161 | attachScreenshots = this.data["attachScreenshots"] as? Int ?? 0
162 | }
163 |
164 | static func getAll() -> [Device] {
165 | let work = Device()
166 | do {
167 | try work.findAll()
168 | } catch {
169 | return [Device]()
170 | }
171 | var rows = [Device]()
172 | for i in 0.. Bool in
180 | return lhs.name < rhs.name
181 | }
182 | return rows
183 | }
184 |
185 | static func get(uuid: String) -> Device? {
186 | let work = Device()
187 | do {
188 | try work.find(["uuid": uuid])
189 | } catch {
190 | return nil
191 | }
192 | if work.results.rows.isEmpty {
193 | return nil
194 | }
195 | let row = Device()
196 | row.to(work.results.rows[0])
197 | return row
198 | }
199 |
200 | static func == (lhs: Device, rhs: Device) -> Bool {
201 | return lhs.uuid == rhs.uuid
202 | }
203 |
204 | override func setup() throws {
205 | try super.setup()
206 |
207 | var hasFastIV = false
208 | var hasUltraIV = false
209 | var hasDeployEggs = false
210 | var hasEncounterMaxWait = false
211 | var hasEncounterDelay = false
212 | var hasToken = false
213 | var hasUltraQuests = false
214 | var hasEnabled = false
215 | var hasAttachScreenshots = false
216 |
217 | let rows = try sqlRows("PRAGMA table_info(\(table()))", params: [String]())
218 | for row in rows {
219 | let name = row.data["name"] as? String ?? "?"
220 | if name == "fastIV" {
221 | hasFastIV = true
222 | } else if name == "ultraIV" {
223 | hasUltraIV = true
224 | } else if name == "deployEggs" {
225 | hasDeployEggs = true
226 | } else if name == "encounterMaxWait" {
227 | hasEncounterMaxWait = true
228 | } else if name == "encounterDelay" {
229 | hasEncounterDelay = true
230 | } else if name == "token" {
231 | hasToken = true
232 | } else if name == "ultraQuests" {
233 | hasUltraQuests = true
234 | } else if name == "enabled" {
235 | hasEnabled = true
236 | } else if name == "attachScreenshots" {
237 | hasAttachScreenshots = true
238 | }
239 | }
240 |
241 | if !hasFastIV {
242 | try sqlExec("ALTER TABLE \(table()) ADD COLUMN fastIV INTEGER DEFAULT 0")
243 | }
244 | if !hasUltraIV {
245 | try sqlExec("ALTER TABLE \(table()) ADD COLUMN ultraIV INTEGER DEFAULT 0")
246 | }
247 | if !hasDeployEggs {
248 | try sqlExec("ALTER TABLE \(table()) ADD COLUMN deployEggs INTEGER DEFAULT 0")
249 | }
250 | if !hasEncounterMaxWait {
251 | try sqlExec("ALTER TABLE \(table()) ADD COLUMN encounterMaxWait INTEGER DEFAULT 7")
252 | }
253 | if !hasEncounterDelay {
254 | try sqlExec("ALTER TABLE \(table()) ADD COLUMN encounterDelay DOUBLE DEFAULT 1.0")
255 | }
256 | if !hasToken {
257 | try sqlExec("ALTER TABLE \(table()) ADD COLUMN token STRING DEFAULT NULL")
258 | }
259 | if !hasUltraQuests {
260 | try sqlExec("ALTER TABLE \(table()) ADD COLUMN ultraQuests INTEGER DEFAULT 0")
261 | }
262 | if !hasEnabled {
263 | try sqlExec("ALTER TABLE \(table()) ADD COLUMN enabled INTEGER DEFAULT 1")
264 | }
265 | if !hasAttachScreenshots {
266 | try sqlExec("ALTER TABLE \(table()) ADD COLUMN attachScreenshots INTEGER DEFAULT 0")
267 | }
268 | }
269 |
270 | }
271 |
--------------------------------------------------------------------------------
/Manager/Sources/RDMUICManager/FileLogger.swift:
--------------------------------------------------------------------------------
1 | //
2 | // FileLogger.swift
3 | // RDM-UIC-Manager
4 | //
5 | // Created by Florian Kostenzer on 28.11.18.
6 | // Modified from: https://github.com/PerfectlySoft/Perfect-Logger/blob/master/Sources/PerfectLogger/FileLogger.swift
7 | //
8 |
9 | #if os(Linux)
10 | import SwiftGlibc
11 | import LinuxBridge
12 | #else
13 | import Darwin
14 | #endif
15 |
16 | import PerfectLib
17 | import Foundation
18 |
19 | class FileLogger: Logger {
20 |
21 | private var file: String
22 | private let fmt = DateFormatter()
23 |
24 | init(file: String, format: String!="yyyy-MM-dd HH:mm:ss ZZZZ") {
25 | self.file = file
26 | fmt.dateFormat = format
27 | }
28 |
29 | private func filelog(priority: String?, _ args: String) {
30 | let dateString = fmt.string(from: Date())
31 | let logFile = File(file)
32 | defer { logFile.close() }
33 | do {
34 | try logFile.open(.append)
35 | if priority != nil {
36 | try logFile.write(string: "\(priority!) [\(dateString)] \(args)\n")
37 | } else {
38 | try logFile.write(string: "[\(dateString)] \(args)\n")
39 | }
40 | } catch { }
41 | }
42 |
43 | func debug(message: String, _ even: Bool) {
44 | filelog(priority: even ? "[DEBUG]" : "[DEBUG]", message)
45 | }
46 |
47 | func info(message: String, _ even: Bool) {
48 | filelog(priority: even ? "[INFO] " : "[INFO]", message)
49 | }
50 |
51 | func warning(message: String, _ even: Bool) {
52 | filelog(priority: even ? "[WARN] " : "[WARNING]", message)
53 | }
54 |
55 | func error(message: String, _ even: Bool) {
56 | filelog(priority: even ? "[ERROR]" : "[ERROR]", message)
57 | }
58 |
59 | func critical(message: String, _ even: Bool) {
60 | filelog(priority: even ? "[CRIT] " : "[CRITICAL]", message)
61 | }
62 |
63 | func terminal(message: String, _ even: Bool) {
64 | filelog(priority: even ? "[EMERG]" : "[EMERG]", message)
65 | }
66 |
67 | func uic(message: String, all: Bool) {
68 | let lines = message.components(separatedBy: "\n")
69 | for line in lines {
70 | if all || line.starts(with: "[") {
71 | filelog(priority: nil, line)
72 | }
73 | }
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/Manager/Sources/RDMUICManager/Shell.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Shell.swift
3 | // RealDeviceMap
4 | //
5 | // Created by Florian Kostenzer on 29.10.18.
6 | //
7 |
8 | import Foundation
9 |
10 | class Shell {
11 |
12 | private var args: [String]
13 |
14 | init (_ args: String...) {
15 | self.args = args
16 | }
17 |
18 | func run(outputPipe: Any?=nil, errorPipe: Any?=nil, inputPipe: Any?=nil, wait: Bool=false) -> Process {
19 | let task = Process()
20 | task.launchPath = "/usr/bin/env"
21 | task.arguments = args
22 | if errorPipe != nil {
23 | task.standardError = errorPipe
24 | }
25 | if inputPipe != nil {
26 | task.standardInput = inputPipe
27 | }
28 | if outputPipe != nil {
29 | task.standardOutput = outputPipe
30 | }
31 | task.launch()
32 | if wait {
33 | task.waitUntilExit()
34 | }
35 | return task
36 | }
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/Manager/Sources/RDMUICManager/main.swift:
--------------------------------------------------------------------------------
1 | //
2 | // main.swift
3 | // RealDeviceMap
4 | //
5 | // Created by Florian Kostenzer on 18.09.18.
6 | //
7 |
8 | import Foundation
9 | import PerfectLib
10 | import PerfectThread
11 | import SQLiteStORM
12 |
13 | if CommandLine.arguments.contains("--help") ||
14 | CommandLine.arguments.contains("-help") ||
15 | CommandLine.arguments.contains("-h") {
16 | print("""
17 | The following flags are available:
18 | `-path path` (default = "..") [The Path to the Folder where UIC is at.]
19 | `-derivedDataPath path` (default = "./DerivedData") [The Path to the DerivedData folder.]
20 | `-timeout seconds` (default = 300) [Restart after x seconds if a test doesn't print anything.]
21 | `-builds count` (default = 2) [Max synchronous builds.]
22 | """)
23 | exit(0)
24 | }
25 |
26 | let logsFolder = Dir("./logs")
27 | if !logsFolder.exists {
28 | do {
29 | try logsFolder.create()
30 | } catch {
31 | Log.terminal(message: "Failed to create logs folder. \((error.localizedDescription))")
32 | }
33 | }
34 | Log.logger = FileLogger(file: "./logs/\(Int(Date().timeIntervalSince1970))-main.log")
35 |
36 | SQLiteConnector.db = "./db.sqlite"
37 |
38 | // Init Tables
39 | let device = Device()
40 | do {
41 | try device.setup()
42 | } catch {
43 | Log.terminal(message: "Failed to setup ORM for Device. \((error.localizedDescription))")
44 | }
45 |
46 | let path: String
47 | if let index = CommandLine.arguments.index(of: "-path"), CommandLine.arguments.count > index + 1 {
48 | path = CommandLine.arguments[index + 1]
49 | } else {
50 | path = ".."
51 | }
52 | let derivedDataPath: String
53 | if let index = CommandLine.arguments.index(of: "-derivedDataPath"), CommandLine.arguments.count > index + 1 {
54 | derivedDataPath = CommandLine.arguments[index + 1]
55 | } else {
56 | derivedDataPath = "./DerivedData"
57 | }
58 | let timeout: Int
59 | if let index = CommandLine.arguments.index(of: "-timeout"), CommandLine.arguments.count > index + 1,
60 | let number = Int(CommandLine.arguments[index + 1]) {
61 | timeout = number
62 | } else {
63 | timeout = 300
64 | }
65 | let builds: Int
66 | if let index = CommandLine.arguments.index(of: "-builds"), CommandLine.arguments.count > index + 1,
67 | let number = Int(CommandLine.arguments[index + 1]) {
68 | builds = number
69 | } else {
70 | builds = 2
71 | }
72 | // Start BuildController
73 | BuildController.global.start(path: path, derivedDataPath: derivedDataPath, timeout: timeout,
74 | maxSimultaneousBuilds: builds)
75 |
76 | // Start CLI
77 | CLI.global.start()
78 |
--------------------------------------------------------------------------------
/Manager/Tests/LinuxMain.swift:
--------------------------------------------------------------------------------
1 | import XCTest
2 | @testable import RDMUICManagerTests
3 |
4 | XCTMain([
5 | testCase(RDMUICManagerTests.allTests),
6 | ])
7 |
--------------------------------------------------------------------------------
/Manager/Tests/RDMUICManagerTests/RDMUICManagerTests.swift:
--------------------------------------------------------------------------------
1 | import XCTest
2 | import Foundation
3 |
4 | @testable import RDMUICManager
5 |
6 | final class RDMUICManagerTests: XCTestCase {
7 |
8 | func test01Example() {
9 | print("HI")
10 | }
11 |
12 | static var allTests = [
13 | ("test01Example", test01Example)
14 | ]
15 | }
16 |
--------------------------------------------------------------------------------
/Podfile:
--------------------------------------------------------------------------------
1 | platform :ios, '9.0'
2 | use_frameworks!
3 |
4 | target 'RealDeviceMap-UIControlUITests' do
5 | pod 'Telegraph', '0.25'
6 | end
7 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # RealDeviceMap-UIControl
2 |
3 | The contents of this repo is a proof of concept and is for educational use only!
4 |
5 | RealDeviceMap-UIControl is a Device Controllers for the RealDeviceMap-Api (https://github.com/RealDeviceMap/RealDeviceMap).
6 |
7 | RealDeviceMap-UIControl interacts with the iOS Device using Xcode UITesting.
8 | This project shows how to UITest 3rd party apps with optical image processing for none standart UIElements and how to setup and use a Webserver in a Xcode UITest.
9 |
10 | Questions? Ask as in Discord: https://discord.gg/q2aXaGP
11 |
--------------------------------------------------------------------------------
/RealDeviceMap-UIControl.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 51;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 2E6D7FAA217E03A70022DA75 /* Config.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2E6D7FA9217E03A70022DA75 /* Config.swift */; };
11 | 2E90E9A221A1BC7700E2D722 /* DeviceConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2E90E9A121A1BC7700E2D722 /* DeviceConfig.swift */; };
12 | 2E90E9A421A1C0DC00E2D722 /* Log.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2E90E9A321A1C0DC00E2D722 /* Log.swift */; };
13 | 2E90E9A621A1C1BF00E2D722 /* DeviceRatio1775.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2E90E9A521A1C1BF00E2D722 /* DeviceRatio1775.swift */; };
14 | 2E90E9A821A1C20700E2D722 /* DeviceConfigProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2E90E9A721A1C20700E2D722 /* DeviceConfigProtocol.swift */; };
15 | 2E90E9AA21A1C24100E2D722 /* DeviceCoordinate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2E90E9A921A1C24100E2D722 /* DeviceCoordinate.swift */; };
16 | 2E90E9AC21A2D7C200E2D722 /* DeviceIPhoneNormal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2E90E9AB21A2D7C200E2D722 /* DeviceIPhoneNormal.swift */; };
17 | 2EEB5E36215E61DD0039B79B /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2EEB5E35215E61DD0039B79B /* AppDelegate.swift */; };
18 | 2EEB5E38215E61DD0039B79B /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2EEB5E37215E61DD0039B79B /* ViewController.swift */; };
19 | 2EEB5E3B215E61DD0039B79B /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2EEB5E39215E61DD0039B79B /* Main.storyboard */; };
20 | 2EEB5E3D215E61DF0039B79B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2EEB5E3C215E61DF0039B79B /* Assets.xcassets */; };
21 | 2EEB5E40215E61DF0039B79B /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2EEB5E3E215E61DF0039B79B /* LaunchScreen.storyboard */; };
22 | 2EEB5E4B215E61DF0039B79B /* RealDeviceMap_UIControlUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2EEB5E4A215E61DF0039B79B /* RealDeviceMap_UIControlUITests.swift */; };
23 | 2EEB5E58215E757E0039B79B /* Misc.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2EEB5E57215E757E0039B79B /* Misc.swift */; };
24 | 6641C36C21B9FCDF00D10877 /* DeviceRatio1333.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6641C36B21B9FCDF00D10877 /* DeviceRatio1333.swift */; };
25 | 85F53E2A1BC168949B1BB5C9 /* Pods_RealDeviceMap_UIControlUITests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 50D618DA921EBD10BFB0AA78 /* Pods_RealDeviceMap_UIControlUITests.framework */; };
26 | /* End PBXBuildFile section */
27 |
28 | /* Begin PBXContainerItemProxy section */
29 | 2EEB5E47215E61DF0039B79B /* PBXContainerItemProxy */ = {
30 | isa = PBXContainerItemProxy;
31 | containerPortal = 2EEB5E2A215E61DD0039B79B /* Project object */;
32 | proxyType = 1;
33 | remoteGlobalIDString = 2EEB5E31215E61DD0039B79B;
34 | remoteInfo = "RealDeviceMap-UIControl";
35 | };
36 | /* End PBXContainerItemProxy section */
37 |
38 | /* Begin PBXFileReference section */
39 | 2E6D7FA9217E03A70022DA75 /* Config.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Config.swift; sourceTree = ""; };
40 | 2E90E9A121A1BC7700E2D722 /* DeviceConfig.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeviceConfig.swift; sourceTree = ""; };
41 | 2E90E9A321A1C0DC00E2D722 /* Log.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Log.swift; sourceTree = ""; };
42 | 2E90E9A521A1C1BF00E2D722 /* DeviceRatio1775.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeviceRatio1775.swift; sourceTree = ""; };
43 | 2E90E9A721A1C20700E2D722 /* DeviceConfigProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeviceConfigProtocol.swift; sourceTree = ""; };
44 | 2E90E9A921A1C24100E2D722 /* DeviceCoordinate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeviceCoordinate.swift; sourceTree = ""; };
45 | 2E90E9AB21A2D7C200E2D722 /* DeviceIPhoneNormal.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeviceIPhoneNormal.swift; sourceTree = ""; };
46 | 2EEB5E32215E61DD0039B79B /* RealDeviceMap-UIControl.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "RealDeviceMap-UIControl.app"; sourceTree = BUILT_PRODUCTS_DIR; };
47 | 2EEB5E35215E61DD0039B79B /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
48 | 2EEB5E37215E61DD0039B79B /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; };
49 | 2EEB5E3A215E61DD0039B79B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
50 | 2EEB5E3C215E61DF0039B79B /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
51 | 2EEB5E3F215E61DF0039B79B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
52 | 2EEB5E41215E61DF0039B79B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
53 | 2EEB5E46215E61DF0039B79B /* RealDeviceMap-UIControlUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "RealDeviceMap-UIControlUITests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
54 | 2EEB5E4A215E61DF0039B79B /* RealDeviceMap_UIControlUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RealDeviceMap_UIControlUITests.swift; sourceTree = ""; };
55 | 2EEB5E4C215E61DF0039B79B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
56 | 2EEB5E57215E757E0039B79B /* Misc.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Misc.swift; sourceTree = ""; };
57 | 3F46BE95C792EAE6E0B7CF21 /* Pods-RealDeviceMap-UIControlUITests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RealDeviceMap-UIControlUITests.release.xcconfig"; path = "Pods/Target Support Files/Pods-RealDeviceMap-UIControlUITests/Pods-RealDeviceMap-UIControlUITests.release.xcconfig"; sourceTree = ""; };
58 | 50D618DA921EBD10BFB0AA78 /* Pods_RealDeviceMap_UIControlUITests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RealDeviceMap_UIControlUITests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
59 | 6641C36B21B9FCDF00D10877 /* DeviceRatio1333.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DeviceRatio1333.swift; sourceTree = ""; };
60 | CE212FE7DC432FB311B7EF39 /* Pods-RealDeviceMap-UIControlUITests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RealDeviceMap-UIControlUITests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-RealDeviceMap-UIControlUITests/Pods-RealDeviceMap-UIControlUITests.debug.xcconfig"; sourceTree = ""; };
61 | /* End PBXFileReference section */
62 |
63 | /* Begin PBXFrameworksBuildPhase section */
64 | 2EEB5E2F215E61DD0039B79B /* Frameworks */ = {
65 | isa = PBXFrameworksBuildPhase;
66 | buildActionMask = 2147483647;
67 | files = (
68 | );
69 | runOnlyForDeploymentPostprocessing = 0;
70 | };
71 | C3EC289FBF33E128A40349AD /* Frameworks */ = {
72 | isa = PBXFrameworksBuildPhase;
73 | buildActionMask = 2147483647;
74 | files = (
75 | 85F53E2A1BC168949B1BB5C9 /* Pods_RealDeviceMap_UIControlUITests.framework in Frameworks */,
76 | );
77 | runOnlyForDeploymentPostprocessing = 0;
78 | };
79 | /* End PBXFrameworksBuildPhase section */
80 |
81 | /* Begin PBXGroup section */
82 | 2003AE5A1D1D23E71444CACD /* Pods */ = {
83 | isa = PBXGroup;
84 | children = (
85 | CE212FE7DC432FB311B7EF39 /* Pods-RealDeviceMap-UIControlUITests.debug.xcconfig */,
86 | 3F46BE95C792EAE6E0B7CF21 /* Pods-RealDeviceMap-UIControlUITests.release.xcconfig */,
87 | );
88 | name = Pods;
89 | sourceTree = "";
90 | };
91 | 2E90E9A021A1BC1800E2D722 /* DeviceConfig */ = {
92 | isa = PBXGroup;
93 | children = (
94 | 6641C36B21B9FCDF00D10877 /* DeviceRatio1333.swift */,
95 | 2E90E9A121A1BC7700E2D722 /* DeviceConfig.swift */,
96 | 2E90E9A521A1C1BF00E2D722 /* DeviceRatio1775.swift */,
97 | 2E90E9A721A1C20700E2D722 /* DeviceConfigProtocol.swift */,
98 | 2E90E9AB21A2D7C200E2D722 /* DeviceIPhoneNormal.swift */,
99 | );
100 | path = DeviceConfig;
101 | sourceTree = "";
102 | };
103 | 2EEB5E29215E61DD0039B79B = {
104 | isa = PBXGroup;
105 | children = (
106 | 2EEB5E34215E61DD0039B79B /* Unused */,
107 | 2EEB5E49215E61DF0039B79B /* RealDeviceMap-UIControl */,
108 | 2EEB5E33215E61DD0039B79B /* Products */,
109 | 2003AE5A1D1D23E71444CACD /* Pods */,
110 | 47D3D2966F1B42D1076F14AA /* Frameworks */,
111 | );
112 | sourceTree = "";
113 | };
114 | 2EEB5E33215E61DD0039B79B /* Products */ = {
115 | isa = PBXGroup;
116 | children = (
117 | 2EEB5E32215E61DD0039B79B /* RealDeviceMap-UIControl.app */,
118 | 2EEB5E46215E61DF0039B79B /* RealDeviceMap-UIControlUITests.xctest */,
119 | );
120 | name = Products;
121 | sourceTree = "";
122 | };
123 | 2EEB5E34215E61DD0039B79B /* Unused */ = {
124 | isa = PBXGroup;
125 | children = (
126 | 2EEB5E35215E61DD0039B79B /* AppDelegate.swift */,
127 | 2EEB5E37215E61DD0039B79B /* ViewController.swift */,
128 | 2EEB5E39215E61DD0039B79B /* Main.storyboard */,
129 | 2EEB5E3C215E61DF0039B79B /* Assets.xcassets */,
130 | 2EEB5E3E215E61DF0039B79B /* LaunchScreen.storyboard */,
131 | 2EEB5E41215E61DF0039B79B /* Info.plist */,
132 | );
133 | path = Unused;
134 | sourceTree = "";
135 | };
136 | 2EEB5E49215E61DF0039B79B /* RealDeviceMap-UIControl */ = {
137 | isa = PBXGroup;
138 | children = (
139 | 2E90E9A021A1BC1800E2D722 /* DeviceConfig */,
140 | 2EEB5E57215E757E0039B79B /* Misc.swift */,
141 | 2EEB5E4A215E61DF0039B79B /* RealDeviceMap_UIControlUITests.swift */,
142 | 2EEB5E4C215E61DF0039B79B /* Info.plist */,
143 | 2E6D7FA9217E03A70022DA75 /* Config.swift */,
144 | 2E90E9A321A1C0DC00E2D722 /* Log.swift */,
145 | 2E90E9A921A1C24100E2D722 /* DeviceCoordinate.swift */,
146 | );
147 | path = "RealDeviceMap-UIControl";
148 | sourceTree = "";
149 | };
150 | 47D3D2966F1B42D1076F14AA /* Frameworks */ = {
151 | isa = PBXGroup;
152 | children = (
153 | 50D618DA921EBD10BFB0AA78 /* Pods_RealDeviceMap_UIControlUITests.framework */,
154 | );
155 | name = Frameworks;
156 | sourceTree = "";
157 | };
158 | /* End PBXGroup section */
159 |
160 | /* Begin PBXNativeTarget section */
161 | 2EEB5E31215E61DD0039B79B /* RealDeviceMap-UIControl */ = {
162 | isa = PBXNativeTarget;
163 | buildConfigurationList = 2EEB5E4F215E61DF0039B79B /* Build configuration list for PBXNativeTarget "RealDeviceMap-UIControl" */;
164 | buildPhases = (
165 | E1A3245A23E1F28600811993 /* ShellScript */,
166 | 2EEB5E2E215E61DD0039B79B /* Sources */,
167 | 2EEB5E2F215E61DD0039B79B /* Frameworks */,
168 | 2EEB5E30215E61DD0039B79B /* Resources */,
169 | );
170 | buildRules = (
171 | );
172 | dependencies = (
173 | );
174 | name = "RealDeviceMap-UIControl";
175 | productName = "RealDeviceMap-UIControl";
176 | productReference = 2EEB5E32215E61DD0039B79B /* RealDeviceMap-UIControl.app */;
177 | productType = "com.apple.product-type.application";
178 | };
179 | 2EEB5E45215E61DF0039B79B /* RealDeviceMap-UIControlUITests */ = {
180 | isa = PBXNativeTarget;
181 | buildConfigurationList = 2EEB5E52215E61DF0039B79B /* Build configuration list for PBXNativeTarget "RealDeviceMap-UIControlUITests" */;
182 | buildPhases = (
183 | 8F7CBC5DD5DF383735CB4CA1 /* [CP] Check Pods Manifest.lock */,
184 | 2EEB5E42215E61DF0039B79B /* Sources */,
185 | C3EC289FBF33E128A40349AD /* Frameworks */,
186 | 71ADC784D861D8D46BFBCF25 /* [CP] Embed Pods Frameworks */,
187 | );
188 | buildRules = (
189 | );
190 | dependencies = (
191 | 2EEB5E48215E61DF0039B79B /* PBXTargetDependency */,
192 | );
193 | name = "RealDeviceMap-UIControlUITests";
194 | productName = "RealDeviceMap-UIControlUITests";
195 | productReference = 2EEB5E46215E61DF0039B79B /* RealDeviceMap-UIControlUITests.xctest */;
196 | productType = "com.apple.product-type.bundle.ui-testing";
197 | };
198 | /* End PBXNativeTarget section */
199 |
200 | /* Begin PBXProject section */
201 | 2EEB5E2A215E61DD0039B79B /* Project object */ = {
202 | isa = PBXProject;
203 | attributes = {
204 | LastSwiftUpdateCheck = 1000;
205 | LastUpgradeCheck = 1000;
206 | ORGANIZATIONNAME = "Florian Kostenzer";
207 | TargetAttributes = {
208 | 2EEB5E31215E61DD0039B79B = {
209 | CreatedOnToolsVersion = 10.0;
210 | };
211 | 2EEB5E45215E61DF0039B79B = {
212 | CreatedOnToolsVersion = 10.0;
213 | TestTargetID = 2EEB5E31215E61DD0039B79B;
214 | };
215 | };
216 | };
217 | buildConfigurationList = 2EEB5E2D215E61DD0039B79B /* Build configuration list for PBXProject "RealDeviceMap-UIControl" */;
218 | compatibilityVersion = "Xcode 9.3";
219 | developmentRegion = en;
220 | hasScannedForEncodings = 0;
221 | knownRegions = (
222 | en,
223 | Base,
224 | );
225 | mainGroup = 2EEB5E29215E61DD0039B79B;
226 | productRefGroup = 2EEB5E33215E61DD0039B79B /* Products */;
227 | projectDirPath = "";
228 | projectRoot = "";
229 | targets = (
230 | 2EEB5E31215E61DD0039B79B /* RealDeviceMap-UIControl */,
231 | 2EEB5E45215E61DF0039B79B /* RealDeviceMap-UIControlUITests */,
232 | );
233 | };
234 | /* End PBXProject section */
235 |
236 | /* Begin PBXResourcesBuildPhase section */
237 | 2EEB5E30215E61DD0039B79B /* Resources */ = {
238 | isa = PBXResourcesBuildPhase;
239 | buildActionMask = 2147483647;
240 | files = (
241 | 2EEB5E40215E61DF0039B79B /* LaunchScreen.storyboard in Resources */,
242 | 2EEB5E3D215E61DF0039B79B /* Assets.xcassets in Resources */,
243 | 2EEB5E3B215E61DD0039B79B /* Main.storyboard in Resources */,
244 | );
245 | runOnlyForDeploymentPostprocessing = 0;
246 | };
247 | /* End PBXResourcesBuildPhase section */
248 |
249 | /* Begin PBXShellScriptBuildPhase section */
250 | 71ADC784D861D8D46BFBCF25 /* [CP] Embed Pods Frameworks */ = {
251 | isa = PBXShellScriptBuildPhase;
252 | buildActionMask = 2147483647;
253 | files = (
254 | );
255 | inputFileListPaths = (
256 | "${PODS_ROOT}/Target Support Files/Pods-RealDeviceMap-UIControlUITests/Pods-RealDeviceMap-UIControlUITests-frameworks-${CONFIGURATION}-input-files.xcfilelist",
257 | );
258 | name = "[CP] Embed Pods Frameworks";
259 | outputFileListPaths = (
260 | "${PODS_ROOT}/Target Support Files/Pods-RealDeviceMap-UIControlUITests/Pods-RealDeviceMap-UIControlUITests-frameworks-${CONFIGURATION}-output-files.xcfilelist",
261 | );
262 | runOnlyForDeploymentPostprocessing = 0;
263 | shellPath = /bin/sh;
264 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-RealDeviceMap-UIControlUITests/Pods-RealDeviceMap-UIControlUITests-frameworks.sh\"\n";
265 | showEnvVarsInLog = 0;
266 | };
267 | 8F7CBC5DD5DF383735CB4CA1 /* [CP] Check Pods Manifest.lock */ = {
268 | isa = PBXShellScriptBuildPhase;
269 | buildActionMask = 2147483647;
270 | files = (
271 | );
272 | inputPaths = (
273 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
274 | "${PODS_ROOT}/Manifest.lock",
275 | );
276 | name = "[CP] Check Pods Manifest.lock";
277 | outputPaths = (
278 | "$(DERIVED_FILE_DIR)/Pods-RealDeviceMap-UIControlUITests-checkManifestLockResult.txt",
279 | );
280 | runOnlyForDeploymentPostprocessing = 0;
281 | shellPath = /bin/sh;
282 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
283 | showEnvVarsInLog = 0;
284 | };
285 | E1A3245A23E1F28600811993 /* ShellScript */ = {
286 | isa = PBXShellScriptBuildPhase;
287 | buildActionMask = 2147483647;
288 | files = (
289 | );
290 | inputFileListPaths = (
291 | );
292 | inputPaths = (
293 | );
294 | outputFileListPaths = (
295 | );
296 | outputPaths = (
297 | );
298 | runOnlyForDeploymentPostprocessing = 0;
299 | shellPath = /bin/sh;
300 | shellScript = "if which swiftlint >/dev/null; then\n swiftlint\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n";
301 | };
302 | /* End PBXShellScriptBuildPhase section */
303 |
304 | /* Begin PBXSourcesBuildPhase section */
305 | 2EEB5E2E215E61DD0039B79B /* Sources */ = {
306 | isa = PBXSourcesBuildPhase;
307 | buildActionMask = 2147483647;
308 | files = (
309 | 2EEB5E38215E61DD0039B79B /* ViewController.swift in Sources */,
310 | 2EEB5E36215E61DD0039B79B /* AppDelegate.swift in Sources */,
311 | );
312 | runOnlyForDeploymentPostprocessing = 0;
313 | };
314 | 2EEB5E42215E61DF0039B79B /* Sources */ = {
315 | isa = PBXSourcesBuildPhase;
316 | buildActionMask = 2147483647;
317 | files = (
318 | 2EEB5E4B215E61DF0039B79B /* RealDeviceMap_UIControlUITests.swift in Sources */,
319 | 2E90E9A221A1BC7700E2D722 /* DeviceConfig.swift in Sources */,
320 | 2E90E9AA21A1C24100E2D722 /* DeviceCoordinate.swift in Sources */,
321 | 2E90E9A421A1C0DC00E2D722 /* Log.swift in Sources */,
322 | 2E90E9A621A1C1BF00E2D722 /* DeviceRatio1775.swift in Sources */,
323 | 6641C36C21B9FCDF00D10877 /* DeviceRatio1333.swift in Sources */,
324 | 2E6D7FAA217E03A70022DA75 /* Config.swift in Sources */,
325 | 2E90E9A821A1C20700E2D722 /* DeviceConfigProtocol.swift in Sources */,
326 | 2E90E9AC21A2D7C200E2D722 /* DeviceIPhoneNormal.swift in Sources */,
327 | 2EEB5E58215E757E0039B79B /* Misc.swift in Sources */,
328 | );
329 | runOnlyForDeploymentPostprocessing = 0;
330 | };
331 | /* End PBXSourcesBuildPhase section */
332 |
333 | /* Begin PBXTargetDependency section */
334 | 2EEB5E48215E61DF0039B79B /* PBXTargetDependency */ = {
335 | isa = PBXTargetDependency;
336 | target = 2EEB5E31215E61DD0039B79B /* RealDeviceMap-UIControl */;
337 | targetProxy = 2EEB5E47215E61DF0039B79B /* PBXContainerItemProxy */;
338 | };
339 | /* End PBXTargetDependency section */
340 |
341 | /* Begin PBXVariantGroup section */
342 | 2EEB5E39215E61DD0039B79B /* Main.storyboard */ = {
343 | isa = PBXVariantGroup;
344 | children = (
345 | 2EEB5E3A215E61DD0039B79B /* Base */,
346 | );
347 | name = Main.storyboard;
348 | sourceTree = "";
349 | };
350 | 2EEB5E3E215E61DF0039B79B /* LaunchScreen.storyboard */ = {
351 | isa = PBXVariantGroup;
352 | children = (
353 | 2EEB5E3F215E61DF0039B79B /* Base */,
354 | );
355 | name = LaunchScreen.storyboard;
356 | sourceTree = "";
357 | };
358 | /* End PBXVariantGroup section */
359 |
360 | /* Begin XCBuildConfiguration section */
361 | 2EEB5E4D215E61DF0039B79B /* Debug */ = {
362 | isa = XCBuildConfiguration;
363 | buildSettings = {
364 | ALWAYS_SEARCH_USER_PATHS = NO;
365 | CLANG_ANALYZER_NONNULL = YES;
366 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
367 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
368 | CLANG_CXX_LIBRARY = "libc++";
369 | CLANG_ENABLE_MODULES = YES;
370 | CLANG_ENABLE_OBJC_ARC = YES;
371 | CLANG_ENABLE_OBJC_WEAK = YES;
372 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
373 | CLANG_WARN_BOOL_CONVERSION = YES;
374 | CLANG_WARN_COMMA = YES;
375 | CLANG_WARN_CONSTANT_CONVERSION = YES;
376 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
377 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
378 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
379 | CLANG_WARN_EMPTY_BODY = YES;
380 | CLANG_WARN_ENUM_CONVERSION = YES;
381 | CLANG_WARN_INFINITE_RECURSION = YES;
382 | CLANG_WARN_INT_CONVERSION = YES;
383 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
384 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
385 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
386 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
387 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
388 | CLANG_WARN_STRICT_PROTOTYPES = YES;
389 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
390 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
391 | CLANG_WARN_UNREACHABLE_CODE = YES;
392 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
393 | CODE_SIGN_IDENTITY = "iPhone Developer";
394 | COPY_PHASE_STRIP = NO;
395 | DEBUG_INFORMATION_FORMAT = dwarf;
396 | ENABLE_STRICT_OBJC_MSGSEND = YES;
397 | ENABLE_TESTABILITY = YES;
398 | GCC_C_LANGUAGE_STANDARD = gnu11;
399 | GCC_DYNAMIC_NO_PIC = NO;
400 | GCC_NO_COMMON_BLOCKS = YES;
401 | GCC_OPTIMIZATION_LEVEL = 0;
402 | GCC_PREPROCESSOR_DEFINITIONS = (
403 | "DEBUG=1",
404 | "$(inherited)",
405 | );
406 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
407 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
408 | GCC_WARN_UNDECLARED_SELECTOR = YES;
409 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
410 | GCC_WARN_UNUSED_FUNCTION = YES;
411 | GCC_WARN_UNUSED_VARIABLE = YES;
412 | IPHONEOS_DEPLOYMENT_TARGET = 12.0;
413 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
414 | MTL_FAST_MATH = YES;
415 | ONLY_ACTIVE_ARCH = YES;
416 | SDKROOT = iphoneos;
417 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
418 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
419 | };
420 | name = Debug;
421 | };
422 | 2EEB5E4E215E61DF0039B79B /* Release */ = {
423 | isa = XCBuildConfiguration;
424 | buildSettings = {
425 | ALWAYS_SEARCH_USER_PATHS = NO;
426 | CLANG_ANALYZER_NONNULL = YES;
427 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
428 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
429 | CLANG_CXX_LIBRARY = "libc++";
430 | CLANG_ENABLE_MODULES = YES;
431 | CLANG_ENABLE_OBJC_ARC = YES;
432 | CLANG_ENABLE_OBJC_WEAK = YES;
433 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
434 | CLANG_WARN_BOOL_CONVERSION = YES;
435 | CLANG_WARN_COMMA = YES;
436 | CLANG_WARN_CONSTANT_CONVERSION = YES;
437 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
438 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
439 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
440 | CLANG_WARN_EMPTY_BODY = YES;
441 | CLANG_WARN_ENUM_CONVERSION = YES;
442 | CLANG_WARN_INFINITE_RECURSION = YES;
443 | CLANG_WARN_INT_CONVERSION = YES;
444 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
445 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
446 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
447 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
448 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
449 | CLANG_WARN_STRICT_PROTOTYPES = YES;
450 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
451 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
452 | CLANG_WARN_UNREACHABLE_CODE = YES;
453 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
454 | CODE_SIGN_IDENTITY = "iPhone Developer";
455 | COPY_PHASE_STRIP = NO;
456 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
457 | ENABLE_NS_ASSERTIONS = NO;
458 | ENABLE_STRICT_OBJC_MSGSEND = YES;
459 | GCC_C_LANGUAGE_STANDARD = gnu11;
460 | GCC_NO_COMMON_BLOCKS = YES;
461 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
462 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
463 | GCC_WARN_UNDECLARED_SELECTOR = YES;
464 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
465 | GCC_WARN_UNUSED_FUNCTION = YES;
466 | GCC_WARN_UNUSED_VARIABLE = YES;
467 | IPHONEOS_DEPLOYMENT_TARGET = 12.0;
468 | MTL_ENABLE_DEBUG_INFO = NO;
469 | MTL_FAST_MATH = YES;
470 | SDKROOT = iphoneos;
471 | SWIFT_COMPILATION_MODE = wholemodule;
472 | SWIFT_OPTIMIZATION_LEVEL = "-O";
473 | VALIDATE_PRODUCT = YES;
474 | };
475 | name = Release;
476 | };
477 | 2EEB5E50215E61DF0039B79B /* Debug */ = {
478 | isa = XCBuildConfiguration;
479 | buildSettings = {
480 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
481 | CODE_SIGN_STYLE = Automatic;
482 | DEVELOPMENT_TEAM = "";
483 | INFOPLIST_FILE = "RealDeviceMap-UIControl/Info.plist";
484 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
485 | LD_RUNPATH_SEARCH_PATHS = (
486 | "$(inherited)",
487 | "@executable_path/Frameworks",
488 | );
489 | PRODUCT_BUNDLE_IDENTIFIER = "yourname.RealDeviceMap-UIControl";
490 | PRODUCT_NAME = "$(TARGET_NAME)";
491 | SWIFT_VERSION = 4.2;
492 | TARGETED_DEVICE_FAMILY = "1,2";
493 | };
494 | name = Debug;
495 | };
496 | 2EEB5E51215E61DF0039B79B /* Release */ = {
497 | isa = XCBuildConfiguration;
498 | buildSettings = {
499 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
500 | CODE_SIGN_STYLE = Automatic;
501 | DEVELOPMENT_TEAM = "";
502 | INFOPLIST_FILE = "RealDeviceMap-UIControl/Info.plist";
503 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
504 | LD_RUNPATH_SEARCH_PATHS = (
505 | "$(inherited)",
506 | "@executable_path/Frameworks",
507 | );
508 | PRODUCT_BUNDLE_IDENTIFIER = "yourname.RealDeviceMap-UIControl";
509 | PRODUCT_NAME = "$(TARGET_NAME)";
510 | SWIFT_VERSION = 4.2;
511 | TARGETED_DEVICE_FAMILY = "1,2";
512 | };
513 | name = Release;
514 | };
515 | 2EEB5E53215E61DF0039B79B /* Debug */ = {
516 | isa = XCBuildConfiguration;
517 | baseConfigurationReference = CE212FE7DC432FB311B7EF39 /* Pods-RealDeviceMap-UIControlUITests.debug.xcconfig */;
518 | buildSettings = {
519 | CODE_SIGN_STYLE = Automatic;
520 | DEVELOPMENT_TEAM = "";
521 | FRAMEWORK_SEARCH_PATHS = (
522 | "$(inherited)",
523 | "$(PROJECT_DIR)/RealDeviceMap-UIControl",
524 | );
525 | INFOPLIST_FILE = "RealDeviceMap-UIControl/Info.plist";
526 | LD_RUNPATH_SEARCH_PATHS = (
527 | "$(inherited)",
528 | "@executable_path/Frameworks",
529 | "@loader_path/Frameworks",
530 | );
531 | PRODUCT_BUNDLE_IDENTIFIER = "yourname.RealDeviceMap-UIControlUITests";
532 | PRODUCT_NAME = "$(TARGET_NAME)";
533 | SWIFT_VERSION = 4.2;
534 | TARGETED_DEVICE_FAMILY = "1,2";
535 | TEST_TARGET_NAME = "RealDeviceMap-UIControl";
536 | };
537 | name = Debug;
538 | };
539 | 2EEB5E54215E61DF0039B79B /* Release */ = {
540 | isa = XCBuildConfiguration;
541 | baseConfigurationReference = 3F46BE95C792EAE6E0B7CF21 /* Pods-RealDeviceMap-UIControlUITests.release.xcconfig */;
542 | buildSettings = {
543 | CODE_SIGN_STYLE = Automatic;
544 | DEVELOPMENT_TEAM = "";
545 | FRAMEWORK_SEARCH_PATHS = (
546 | "$(inherited)",
547 | "$(PROJECT_DIR)/RealDeviceMap-UIControl",
548 | );
549 | INFOPLIST_FILE = "RealDeviceMap-UIControl/Info.plist";
550 | LD_RUNPATH_SEARCH_PATHS = (
551 | "$(inherited)",
552 | "@executable_path/Frameworks",
553 | "@loader_path/Frameworks",
554 | );
555 | PRODUCT_BUNDLE_IDENTIFIER = "yourname.RealDeviceMap-UIControlUITests";
556 | PRODUCT_NAME = "$(TARGET_NAME)";
557 | SWIFT_VERSION = 4.2;
558 | TARGETED_DEVICE_FAMILY = "1,2";
559 | TEST_TARGET_NAME = "RealDeviceMap-UIControl";
560 | };
561 | name = Release;
562 | };
563 | /* End XCBuildConfiguration section */
564 |
565 | /* Begin XCConfigurationList section */
566 | 2EEB5E2D215E61DD0039B79B /* Build configuration list for PBXProject "RealDeviceMap-UIControl" */ = {
567 | isa = XCConfigurationList;
568 | buildConfigurations = (
569 | 2EEB5E4D215E61DF0039B79B /* Debug */,
570 | 2EEB5E4E215E61DF0039B79B /* Release */,
571 | );
572 | defaultConfigurationIsVisible = 0;
573 | defaultConfigurationName = Release;
574 | };
575 | 2EEB5E4F215E61DF0039B79B /* Build configuration list for PBXNativeTarget "RealDeviceMap-UIControl" */ = {
576 | isa = XCConfigurationList;
577 | buildConfigurations = (
578 | 2EEB5E50215E61DF0039B79B /* Debug */,
579 | 2EEB5E51215E61DF0039B79B /* Release */,
580 | );
581 | defaultConfigurationIsVisible = 0;
582 | defaultConfigurationName = Release;
583 | };
584 | 2EEB5E52215E61DF0039B79B /* Build configuration list for PBXNativeTarget "RealDeviceMap-UIControlUITests" */ = {
585 | isa = XCConfigurationList;
586 | buildConfigurations = (
587 | 2EEB5E53215E61DF0039B79B /* Debug */,
588 | 2EEB5E54215E61DF0039B79B /* Release */,
589 | );
590 | defaultConfigurationIsVisible = 0;
591 | defaultConfigurationName = Release;
592 | };
593 | /* End XCConfigurationList section */
594 | };
595 | rootObject = 2EEB5E2A215E61DD0039B79B /* Project object */;
596 | }
597 |
--------------------------------------------------------------------------------
/RealDeviceMap-UIControl.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/RealDeviceMap-UIControl.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/RealDeviceMap-UIControl.xcodeproj/xcshareddata/xcschemes/RealDeviceMap-UIControl.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
31 |
32 |
34 |
40 |
41 |
42 |
43 |
44 |
50 |
51 |
52 |
53 |
54 |
55 |
65 |
67 |
73 |
74 |
75 |
76 |
80 |
81 |
85 |
86 |
90 |
91 |
95 |
96 |
100 |
101 |
105 |
106 |
110 |
111 |
115 |
116 |
120 |
121 |
125 |
126 |
130 |
131 |
135 |
136 |
140 |
141 |
145 |
146 |
150 |
151 |
155 |
156 |
160 |
161 |
165 |
166 |
170 |
171 |
175 |
176 |
180 |
181 |
185 |
186 |
190 |
191 |
195 |
196 |
200 |
201 |
205 |
206 |
210 |
211 |
212 |
213 |
214 |
215 |
221 |
223 |
229 |
230 |
231 |
232 |
234 |
235 |
238 |
239 |
240 |
--------------------------------------------------------------------------------
/RealDeviceMap-UIControl.xcodeproj/xcshareddata/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | RealDeviceMap-UIControl.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | 2EEB5E31215E61DD0039B79B
16 |
17 | primary
18 |
19 |
20 | 2EEB5E45215E61DF0039B79B
21 |
22 | primary
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/RealDeviceMap-UIControl/Config.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Config.swift
3 | // RealDeviceMap-UIControlUITests
4 | //
5 | // Created by Florian Kostenzer on 22.10.18.
6 | //
7 |
8 | import Foundation
9 |
10 | class Config {
11 |
12 | public static let global = Config()
13 |
14 | var uuid: String
15 | var backendURLBaseString: String
16 | var enableAccountManager: Bool
17 | var port: Int
18 | var pokemonMaxTime: Double
19 | var raidMaxTime: Double
20 | var maxWarningTimeRaid: Int
21 | var delayMultiplier: UInt32
22 | var jitterValue: Double
23 | var targetMaxDistance: Double
24 | var itemFullCount: Int
25 | var questFullCount: Int
26 | var itemsPerStop: Int
27 | var minDelayLogout: Double
28 | var maxNoQuestCount: Int
29 | var maxFailedCount: Int
30 | var maxEmptyGMO: Int
31 | var maxNoEncounterCount: Int
32 | var startupLocation: (lat: Double, lon: Double)
33 | var encounterMaxWait: UInt32
34 | var encounterDelay: Double
35 | var fastIV: Bool
36 | var ultraIV: Bool
37 | var deployEggs: Bool
38 | var token: String
39 | var ultraQuests: Bool
40 | var enabled: Bool
41 | var attachScreenshots: Bool
42 |
43 | init() {
44 |
45 | let enviroment = ProcessInfo.processInfo.environment
46 |
47 | uuid = enviroment["name"] ?? ""
48 | backendURLBaseString = enviroment["backendURL"] ?? ""
49 | enableAccountManager = enviroment["enableAccountManager"]?.toBool() ?? false
50 | port = enviroment["port"]?.toInt() ?? 8080
51 | pokemonMaxTime = enviroment["pokemonMaxTime"]?.toDouble() ?? 45.0
52 | raidMaxTime = enviroment["raidMaxTime"]?.toDouble() ?? 25.0
53 | maxWarningTimeRaid = enviroment["maxWarningTimeRaid"]?.toInt() ?? 432000
54 | delayMultiplier = enviroment["delayMultiplier"]?.toUInt32() ?? 1
55 | jitterValue = enviroment["jitterValue"]?.toDouble() ?? 0.00005
56 | targetMaxDistance = enviroment["targetMaxDistance"]?.toDouble() ?? 250.0
57 | itemFullCount = enviroment["itemFullCount"]?.toInt() ?? 250
58 | questFullCount = enviroment["questFullCount"]?.toInt() ?? 3
59 | itemsPerStop = enviroment["itemsPerStop"]?.toInt() ?? 10
60 | minDelayLogout = enviroment["minDelayLogout"]?.toDouble() ?? 180.0
61 | maxNoQuestCount = enviroment["maxNoQuestCount"]?.toInt() ?? 5
62 | maxNoEncounterCount = enviroment["maxNoEncounterCount"]?.toInt() ?? 5
63 | maxFailedCount = enviroment["maxFailedCount"]?.toInt() ?? 5
64 | maxEmptyGMO = enviroment["maxEmptyGMO"]?.toInt() ?? 5
65 | let startupLat = enviroment["startupLocationLat"]?.toDouble() ?? 1.0
66 | let startupLon = enviroment["startupLocationLon"]?.toDouble() ?? 1.0
67 | startupLocation = (startupLat, startupLon)
68 | encounterMaxWait = enviroment["encounterMaxWait"]?.toUInt32() ?? 7
69 | encounterDelay = enviroment["encounterDelay"]?.toDouble() ?? 1.0
70 | fastIV = enviroment["fastIV"]?.toBool() ?? false
71 | ultraIV = enviroment["ultraIV"]?.toBool() ?? false
72 | deployEggs = enviroment["deployEggs"]?.toBool() ?? false
73 | token = enviroment["token"] ?? ""
74 | ultraQuests = enviroment["ultraQuests"]?.toBool() ?? false
75 | enabled = enviroment["enabled"]?.toBool() ?? true
76 | attachScreenshots = enviroment["attachScreenshots"]?.toBool() ?? false
77 | }
78 |
79 | }
80 |
--------------------------------------------------------------------------------
/RealDeviceMap-UIControl/DeviceConfig/DeviceConfig.swift:
--------------------------------------------------------------------------------
1 | //
2 | // DeviceConfig.swift
3 | // RealDeviceMap-UIControlUITests
4 | //
5 | // Created by Florian Kostenzer on 18.11.18.
6 | //
7 |
8 | import Foundation
9 | import XCTest
10 |
11 | class DeviceConfig {
12 |
13 | public static private(set) var global: DeviceConfigProtocol!
14 |
15 | public static func setup(app: XCUIApplication) {
16 |
17 | let tapMultiplier: Double
18 | if #available(iOS 13.0, *) {
19 | tapMultiplier = 0.5
20 | } else {
21 | tapMultiplier = 1.0
22 | }
23 |
24 | let ratio = Int(app.frame.size.height / app.frame.size.width * 1000)
25 |
26 | if ratio >= 1770 && ratio <= 1780 { // iPhones
27 | switch app.frame.size.width {
28 | case 375: // iPhone Normal
29 | // This has no use and is an example only
30 | global = DeviceIPhoneNormal(
31 | width: Int(app.frame.size.width),
32 | height: Int(app.frame.size.height),
33 | multiplier: 1.0,
34 | tapMultiplier: tapMultiplier
35 | )
36 | case 414: // iPhone Large
37 | global = DeviceRatio1775(
38 | width: Int(app.frame.size.width),
39 | height: Int(app.frame.size.height),
40 | multiplier: 1.5,
41 | tapMultiplier: tapMultiplier
42 | )
43 | default: // other iPhones
44 | global = DeviceRatio1775(
45 | width: Int(app.frame.size.width),
46 | height: Int(app.frame.size.height),
47 | multiplier: 1.0,
48 | tapMultiplier: tapMultiplier
49 | )
50 | }
51 | } else if ratio >= 1330 && ratio <= 1340 { // iPad
52 | global = DeviceRatio1333(
53 | width: Int(app.frame.size.width),
54 | height: Int(app.frame.size.height),
55 | multiplier: 1.0,
56 | tapMultiplier: tapMultiplier
57 | )
58 | } else {
59 | Log.error("Unsuported Device")
60 | fatalError("Unsuported Device")
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/RealDeviceMap-UIControl/DeviceConfig/DeviceConfigProtocol.swift:
--------------------------------------------------------------------------------
1 | //
2 | // DeviceConfigProtocol.swift
3 | // RealDeviceMap-UIControlUITests
4 | //
5 | // Created by Florian Kostenzer on 18.11.18.
6 | //
7 |
8 | import Foundation
9 |
10 | protocol DeviceConfigProtocol {
11 |
12 | // MARK: - Startup
13 |
14 | /** Green pixel in green button of startup popup. */
15 | var startup: DeviceCoordinate { get }
16 |
17 | // Handling Multiple startup prompts
18 | /* White Pixel (on 3 line prompt) or Greenish-Blue Pixel (on 2 line prompt) bottom right corner of 2line popup */
19 | var startupOldCornerTest: DeviceCoordinate { get }
20 | /* light Green Pixel, Inside the OK button, centered between OK, kept same pixels despite height change */
21 | var startupOldOkButton: DeviceCoordinate { get }
22 | /* light green pixel, Cenetered inside OK button again, just lower */
23 | var startupNewButton: DeviceCoordinate { get }
24 | /* Yellow pixel, in upper section of traingle, below the black outline border*/
25 | var startupNewCautionSign: DeviceCoordinate { get }
26 | /** Green pixel in green button of log in button if not logged in. */
27 | var startupLoggedOut: DeviceCoordinate { get }
28 | /** Green pixel in green button of submit if not age verified. */
29 | var ageVerification: DeviceCoordinate { get }
30 | /** Inside Year Drop dwon box on startup screen */
31 | var ageVerificationYear: DeviceCoordinate { get }
32 | /** Startup and end location from scroll in Age Verification */
33 | var ageVerificationDragStart: DeviceCoordinate { get }
34 | var ageVerificationDragEnd: DeviceCoordinate { get }
35 | /** ? pixel in ? of logged out. */
36 | var passenger: DeviceCoordinate { get }
37 | /** ? pixel in ? of weather popup */
38 | var weather: DeviceCoordinate { get }
39 | /** Button to close weather popup Step 1. */
40 | var closeWeather1: DeviceCoordinate { get }
41 | /** Button to close weather popup Step 2. */
42 | var closeWeather2: DeviceCoordinate { get }
43 | /** Button to close warning (First Strike). */
44 | var closeWarning: DeviceCoordinate { get }
45 | /** Empty place to close news. */
46 | var closeNews: DeviceCoordinate { get }
47 | /** Black pixel in warning (First Strike) popup on the left side. */
48 | var compareWarningL: DeviceCoordinate { get }
49 | /** Black pixel in warning (First Strike) popup on the right side. */
50 | var compareWarningR: DeviceCoordinate { get }
51 | /** Trying to Fix The persisting Login Issue **/
52 | var closeFailedLogin: DeviceCoordinate { get }
53 |
54 | // MARK: - Misc
55 | /** Button to opten nenu. Also white pixel in Pokeball on main screen. */
56 | var closeMenu: DeviceCoordinate { get }
57 | /** Red pixel in Pokeball on main screen. */
58 | var mainScreenPokeballRed: DeviceCoordinate { get }
59 | /** White pixel in close button on setting page(when pokeball first tapped). */
60 | var settingPageCloseButton: DeviceCoordinate { get }
61 | /** Dark blue color of bottom Left corner of logout scroll page . */
62 | var logoutDarkBluePageBottomLeft: DeviceCoordinate {get}
63 | /** Dark blue color of top right corner of logout scroll page . */
64 | var logoutDarkBluePageTopRight: DeviceCoordinate {get}
65 |
66 | // MARK: - Logout
67 |
68 | /** Button to open settings. */
69 | var settingsButton: DeviceCoordinate { get }
70 | /** Coord to start drag at for clicking logout. */
71 | var logoutDragStart: DeviceCoordinate { get }
72 | /** Coord to end drag at for clicking logout. */
73 | var logoutDragEnd: DeviceCoordinate { get }
74 | /** Button to confirm logout. */
75 | var logoutConfirm: DeviceCoordinate { get }
76 | /** X value to search green boarder of logout button at from top to bottom */
77 | var logoutCompareX: Int { get }
78 | /** Coord to start drag at for clicking logout for second time. */
79 | var logoutDragStart2: DeviceCoordinate { get }
80 | /** Coord to end drag at for clicking logout for second time. */
81 | var logoutDragEnd2: DeviceCoordinate { get }
82 |
83 | // MARK: - Pokemon Encounter
84 |
85 | /** Coord to click at to enter Pokemon encounter. */
86 | var encounterPokemonUpper: DeviceCoordinate { get }
87 | var encounterPokemonUpperHigher: DeviceCoordinate { get }
88 | /** Coord to click at to enter Pokemon encounter. */
89 | var encounterPokemonLower: DeviceCoordinate { get }
90 | /** Green pixel in green button of no AR(+) button. */
91 | var encounterNoAR: DeviceCoordinate { get }
92 | /** Green button of no AR(+) confirm button. */
93 | var encounterNoARConfirm: DeviceCoordinate { get }
94 | /** Temp! Exit AR-Mode. */
95 | var encounterTmp: DeviceCoordinate { get }
96 | /** White pixel in run from Pokemon button. */
97 | var encounterPokemonRun: DeviceCoordinate { get }
98 | /** Rex pixel in in switch Pokeball button. */
99 | var encounterPokeball: DeviceCoordinate { get }
100 | /** Check White Pixel in AR button above Scroll bar of Toggel */
101 | var checkARPersistence: DeviceCoordinate { get }
102 |
103 | // MARK: - Pokestop Encounter
104 |
105 | /** Coord to click at to open Pokestop. */
106 | var openPokestop: DeviceCoordinate { get }
107 | /** Upper R logo on girl **/
108 | var rocketLogoGirl: DeviceCoordinate { get }
109 | /** Upper R logo on guy **/
110 | var rocketLogoGuy: DeviceCoordinate { get }
111 | /** Invasion battle screen close **/
112 | var closeInvasion: DeviceCoordinate { get }
113 |
114 | // MARK: - Quest Clearing
115 |
116 | /** Open quests button. */
117 | var openQuest: DeviceCoordinate { get }
118 | /** First delete quests button. */
119 | var questDelete: DeviceCoordinate { get }
120 | /** First delete Quest Button if stacked Encounter is present */
121 | var questDeleteWithStack: DeviceCoordinate { get }
122 | /** Green confirm quest deletion button */
123 | var questDeleteConfirm: DeviceCoordinate { get }
124 | /** Check for the pokeball on Willow's desk. */
125 | var questWillow: DeviceCoordinate { get }
126 | /** Third delete Quest Button if stacked Encounter is present */
127 | var questDeleteThirdSlot: DeviceCoordinate { get }
128 |
129 | // MARK: - Item Clearing
130 |
131 | /** Open items button in menu. */
132 | var openItems: DeviceCoordinate { get }
133 | /** Increase delete item amount button. */
134 | var itemDeleteIncrease: DeviceCoordinate { get }
135 | /** Confirm item deletion button. */
136 | var itemDeleteConfirm: DeviceCoordinate { get }
137 | /** The X value for all item delete buttons of a grey pixel at itemDeleteYs. */
138 | var itemDeleteX: Int { get }
139 | /** A pink pixel in gift at itemDeleteYs. */
140 | var itemGiftX: Int { get }
141 | /** The Y values for all item delete buttons. */
142 | var itemDeleteYs: [Int] { get }
143 | /** Blue pixel in egg at itemDeleteYs */
144 | var itemEggX: Int { get }
145 | /** Lucky Egg Menu Item: Will always be first after deletetion unless active Credit: */
146 | var itemEggMenuItem: DeviceCoordinate { get }
147 | /** Tap Location for Egg Deployment */
148 | var itemEggDeploy: DeviceCoordinate { get }
149 | /** The Y values for all item delete buttons. */
150 | var itemIncenseYs: [Int] { get }
151 | /** Free Pass OK button. */
152 | var itemFreePass: DeviceCoordinate { get }
153 | /** Gift info OK button. */
154 | var itemGiftInfo: DeviceCoordinate { get }
155 |
156 | // MARK: - Login
157 |
158 | /** New player button. */
159 | var loginNewPlayer: DeviceCoordinate { get }
160 | /** Login with PTC button. */
161 | var loginPTC: DeviceCoordinate { get }
162 | /** Login username text field */
163 | var loginUsernameTextfield: DeviceCoordinate { get }
164 | /** Login password text field */
165 | var loginPasswordTextfield: DeviceCoordinate { get }
166 | /** Login button */
167 | var loginConfirm: DeviceCoordinate { get }
168 | /** ? pixel in background of suspension notice */
169 | var loginBannedBackground: DeviceCoordinate { get }
170 | /** Green pixel in "TRY A DIFFERENT ACCOUNT" button of "Failed to login" popup*/
171 | var loginBannedText: DeviceCoordinate { get }
172 | /** Green pixel in "Retry" button of "Failed to login" popup*/
173 | var loginBanned: DeviceCoordinate { get }
174 | /** "Switch Accounts" button of "Failed to login" popup */
175 | var loginBannedSwitchAccount: DeviceCoordinate { get }
176 | /** Black pixel in terms (new account) popup thats white in all other login popups */
177 | var loginTermsText: DeviceCoordinate { get }
178 | /** Green pixel in button of terms (new account) popup */
179 | var loginTerms: DeviceCoordinate { get }
180 | /** Black pixel in terms (old account) popup thats white in all other login popups */
181 | var loginTerms2Text: DeviceCoordinate { get }
182 | /** Green pixel in button of terms (old account) popup */
183 | var loginTerms2: DeviceCoordinate { get }
184 | /** Black pixel in "Invalid Credentials" popup thats white in all other login popups */
185 | var loginFailedText: DeviceCoordinate { get }
186 | /** Green pixel in button of "Invalid Credential" popup */
187 | var loginFailed: DeviceCoordinate { get }
188 | /** Green pixel in button of privacy popup (Privacy button) */
189 | var loginPrivacyText: DeviceCoordinate { get }
190 | /** Green pixel in button of privacy popup (OK button)*/
191 | var loginPrivacy: DeviceCoordinate { get }
192 | /** Black pixel in text of privacy update popup */
193 | var loginPrivacyUpdateText: DeviceCoordinate { get }
194 | /** Green pixel in button of privacy update popup (OK button)*/
195 | var loginPrivacyUpdate: DeviceCoordinate { get }
196 | /** Black pixel in bottom row of text in the unable to authenticate popup */
197 | var unableAuthText: DeviceCoordinate { get }
198 | /** Green pixel in the OK button */
199 | var unableAuthButton: DeviceCoordinate { get }
200 |
201 | // MARK: - Tutorial
202 |
203 | /** Dark pixel in warning initial Tutorial screen on the left side. */
204 | var compareTutorialL: DeviceCoordinate { get }
205 | /** Dark pixel in warning initial Tutorial screen on the right side. */
206 | var compareTutorialR: DeviceCoordinate { get }
207 | /** Next button in bottom right. */
208 | var tutorialNext: DeviceCoordinate { get }
209 | /** Character Setup Main Selection buttons */
210 | /** Are you done? -> Yes. */
211 | var tutorialStyleDone: DeviceCoordinate { get }
212 | /** Ok button on catch overview screen. */
213 | var tutorialCatchOk: DeviceCoordinate { get }
214 | /** Close Pokemon after catch. */
215 | var tutorialCatchClose: DeviceCoordinate { get }
216 | /** Done button on keybord. */
217 | var tutorialKeybordDone: DeviceCoordinate { get }
218 | /** Ok buttom in username popup. */
219 | var tutorialUsernameOk: DeviceCoordinate { get }
220 | /** Confirm username button. */
221 | var tutorialUsernameConfirm: DeviceCoordinate { get }
222 | /** Green On Willow */
223 | var tutorialProfessorCheck: DeviceCoordinate { get }
224 | /** Name Says It All **/
225 |
226 | /** Back Button in Bottom Left of Avatar Setup **/
227 | var tutorialBack: DeviceCoordinate { get }
228 | /** Center of the Item Menu in Avatar Customization **/
229 | var tutorialSelectY: Int { get }
230 | /** X Location of Physical Options in Avatar Customization **/
231 | var tutorialPhysicalXs: [Int] { get }
232 | /** Location of all Hair Color Options that are not Default **/
233 | var tutorialHairXs: [Int] { get }
234 | /** Location of all Eye Color Options that are not Default **/
235 | var tutorialEyeXs: [Int] { get }
236 | /** Location of all Skin Color Options that are not Default **/
237 | var tutorialSkinXs: [Int] { get }
238 | /** X button in center of screen below Avatar Items **/
239 | var tutorialStyleBack: DeviceCoordinate { get }
240 | /** Pink Change button above avatar items when selecting new item **/
241 | var tutorialStyleChange: DeviceCoordinate { get }
242 |
243 | var tutorialMaleStyleXs: [Int] { get }
244 | var tutorialFemaleStyleXs: [Int] { get }
245 | var tutorialPoseAndBackpackX: Int { get }
246 | var tutorialSharedStyleXs: [Int] { get }
247 |
248 | // MARK: - Adventure Sync
249 | /** Pink Pixel in background of "Rewards" in adventure sync popup */
250 | var adventureSyncRewards: DeviceCoordinate { get }
251 | /** Green/Blue or Pixel in claim/close button of adventure sync popup */
252 | var adventureSyncButton: DeviceCoordinate { get }
253 |
254 | // MARK: - Team Select
255 |
256 | /** Background of team select screen (left side) */
257 | var teamSelectBackgorundL: DeviceCoordinate { get }
258 | /** Background of team select screen (right side) */
259 | var teamSelectBackgorundR: DeviceCoordinate { get }
260 | /** Next Button in Team select */
261 | var teamSelectNext: DeviceCoordinate { get }
262 | /** Y value of of Team Leaders */
263 | var teamSelectY: Int { get }
264 | /** Ok button in welcome to team */
265 | var teamSelectWelcomeOk: DeviceCoordinate { get }
266 |
267 | }
268 |
--------------------------------------------------------------------------------
/RealDeviceMap-UIControl/DeviceConfig/DeviceIPhoneNormal.swift:
--------------------------------------------------------------------------------
1 | //
2 | // DeviceIPhoneNormal.swift
3 | // RealDeviceMap-UIControlUITests
4 | //
5 | // Created by Florian Kostenzer on 19.11.18.
6 | //
7 |
8 | import Foundation
9 |
10 | class DeviceIPhoneNormal: DeviceRatio1775 {
11 |
12 | // All values not overriden here default to DeviceRatio1775s values
13 | override var startup: DeviceCoordinate {
14 | return DeviceCoordinate(x: 325, y: 960, tapScaler: tapScaler)
15 | }
16 | override var startupNewButton: DeviceCoordinate {
17 | return DeviceCoordinate(x: 475, y: 960, tapScaler: tapScaler)
18 | }
19 | override var startupNewCautionSign: DeviceCoordinate {
20 | return DeviceCoordinate(x: 375, y: 385, tapScaler: tapScaler)
21 | }
22 | override var loginTerms2Text: DeviceCoordinate {
23 | return DeviceCoordinate(x: 188, y: 450, tapScaler: tapScaler)
24 | }
25 | override var loginTerms2: DeviceCoordinate {
26 | return DeviceCoordinate(x: 375, y: 725, tapScaler: tapScaler)
27 | }
28 | override var startupLoggedOut: DeviceCoordinate {
29 | return DeviceCoordinate(x: 400, y: 115, tapScaler: tapScaler)
30 | }
31 | override var encounterNoARConfirm: DeviceCoordinate { //no AR popup after saying no on iPhone6
32 | return DeviceCoordinate(x: 0, y: 0, tapScaler: tapScaler)
33 | }
34 | override var encounterTmp: DeviceCoordinate {
35 | return DeviceCoordinate(x: 0, y: 0, tapScaler: tapScaler)
36 | }
37 | override var closeFailedLogin: DeviceCoordinate {
38 | return DeviceCoordinate(x: 383, y: 779, tapScaler: tapScaler)
39 | }
40 | override var loginNewPlayer: DeviceCoordinate {
41 | return DeviceCoordinate(x: 320, y: 925, tapScaler: tapScaler)
42 | }
43 | override var loginPrivacyUpdateText: DeviceCoordinate {
44 | return DeviceCoordinate(x: 133, y: 459, tapScaler: tapScaler)
45 | }
46 | override var loginPrivacyUpdate: DeviceCoordinate {
47 | return DeviceCoordinate(x: 375, y: 745, tapScaler: tapScaler)
48 | }
49 |
50 | // MARK: - Item Clearing
51 |
52 | override var itemDeleteIncrease: DeviceCoordinate {
53 | return DeviceCoordinate(x: 540, y: 573, tapScaler: tapScaler)
54 | }
55 | override var itemDeleteConfirm: DeviceCoordinate {
56 | return DeviceCoordinate(x: 320, y: 826, tapScaler: tapScaler)
57 | }
58 | override var itemDeleteX: Int {
59 | return 686
60 | }
61 | override var itemGiftX: Int {
62 | return 156
63 | }
64 | override var itemEggX: Int {
65 | return 173
66 | }
67 | override var itemDeleteYs: [Int] {
68 | return [
69 | 252,
70 | 516,
71 | 785,
72 | 1053,
73 | 1315
74 | ]
75 | }
76 |
77 | }
78 |
--------------------------------------------------------------------------------
/RealDeviceMap-UIControl/DeviceConfig/DeviceRatio1333.swift:
--------------------------------------------------------------------------------
1 | //
2 | // DeviceRatio1333.swift
3 | // RealDeviceMap-UIControlUITests
4 | //
5 | // Created by Florian Kostenzer on 18.11.18.
6 | //
7 | // swiftlint:disable type_body_length file_length
8 | //
9 |
10 | import Foundation
11 | import XCTest
12 |
13 | class DeviceRatio1333: DeviceConfigProtocol {
14 |
15 | private var scaler: DeviceCoordinateScaler
16 |
17 | required init(width: Int, height: Int, multiplier: Double=1.0, tapMultiplier: Double=1.0) {
18 | self.scaler = DeviceCoordinateScaler(
19 | widthNow: width,
20 | heightNow: height,
21 | widthTarget: 768,
22 | heightTarget: 1024,
23 | multiplier: multiplier,
24 | tapMultiplier: tapMultiplier
25 | )
26 | }
27 | // MARK: - Startup
28 |
29 | var startup: DeviceCoordinate {
30 | return DeviceCoordinate(x: 728, y: 1542, scaler: scaler) //was 1234
31 | }
32 | var startupLoggedOut: DeviceCoordinate {
33 | return DeviceCoordinate(x: 807, y: 177, scaler: scaler)
34 | }
35 | // Handling Multiple startup prompts
36 | var startupOldCornerTest: DeviceCoordinate {
37 | return DeviceCoordinate(x: 0, y: 0, scaler: scaler)
38 | }
39 | var startupOldOkButton: DeviceCoordinate {
40 | return DeviceCoordinate(x: 0, y: 0, scaler: scaler)
41 | }
42 | var startupNewButton: DeviceCoordinate {
43 | return DeviceCoordinate(x: 0, y: 0, scaler: scaler)
44 | }
45 | var startupNewCautionSign: DeviceCoordinate {
46 | return DeviceCoordinate(x: 0, y: 0, scaler: scaler)
47 | }
48 | //Find coords by scaling to 640x1136
49 | var ageVerification: DeviceCoordinate {
50 | return DeviceCoordinate(x: 775, y: 1520, scaler: scaler)
51 | }
52 | var ageVerificationYear: DeviceCoordinate {
53 | return DeviceCoordinate(x: 1040, y: 1230, scaler: scaler)
54 | }
55 | var ageVerificationDragStart: DeviceCoordinate {
56 | return DeviceCoordinate(x: 1030, y: 1780, scaler: scaler)
57 | }
58 | var ageVerificationDragEnd: DeviceCoordinate {
59 | return DeviceCoordinate(x: 1030, y: 0, scaler: scaler)
60 | }
61 | var passenger: DeviceCoordinate {
62 | return DeviceCoordinate(x: 768, y: 1567, scaler: scaler)
63 | }
64 | var weather: DeviceCoordinate {
65 | return DeviceCoordinate(x: 768, y: 1360, scaler: scaler)
66 | }
67 | var closeWeather1: DeviceCoordinate {
68 | return DeviceCoordinate(x: 1300, y: 1700, scaler: scaler)
69 | }
70 | var closeWeather2: DeviceCoordinate {
71 | return DeviceCoordinate(x: 768, y: 2000, scaler: scaler)
72 | }
73 | var closeWarning: DeviceCoordinate {
74 | return DeviceCoordinate(x: 768, y: 1800, scaler: scaler)
75 | }
76 | var closeNews: DeviceCoordinate {
77 | return DeviceCoordinate(x: 768, y: 1700, scaler: scaler)
78 | }
79 | var compareWarningL: DeviceCoordinate {
80 | return DeviceCoordinate(x: 90, y: 1800, scaler: scaler)
81 | }
82 | var compareWarningR: DeviceCoordinate {
83 | return DeviceCoordinate(x: 1400, y: 1800, scaler: scaler)
84 | }
85 | var closeFailedLogin: DeviceCoordinate {
86 | return DeviceCoordinate(x: 765, y: 1250, scaler: scaler)
87 | }
88 |
89 | // MARK: - Misc
90 |
91 | var closeMenu: DeviceCoordinate {
92 | return DeviceCoordinate(x: 770, y: 1874, scaler: scaler)
93 | }
94 | // Untested. Need to be adjusted!!!
95 | var mainScreenPokeballRed: DeviceCoordinate {
96 | return DeviceCoordinate(x: 768, y: 1790, scaler: scaler)
97 | }
98 | // Untested. Need to be adjusted!!!
99 | var settingPageCloseButton: DeviceCoordinate {
100 | return DeviceCoordinate(x: 768, y: 1850, scaler: scaler)
101 | }
102 |
103 | // MARK: - Logout
104 |
105 | var settingsButton: DeviceCoordinate {
106 | return DeviceCoordinate(x: 1445, y: 270, scaler: scaler)
107 | }
108 | var logoutDragStart: DeviceCoordinate {
109 | return DeviceCoordinate(x: 300, y: 1980, scaler: scaler)
110 | }
111 | var logoutDragEnd: DeviceCoordinate {
112 | return DeviceCoordinate(x: 300, y: 0, scaler: scaler)
113 | }
114 | var logoutConfirm: DeviceCoordinate {
115 | return DeviceCoordinate(x: 768, y: 1025, scaler: scaler)
116 | }
117 | var logoutCompareX: Int {
118 | return scaler.scaleY(y: 948)
119 | }
120 |
121 | // following 4 variables are not tested. Need to be adjusted.
122 | var logoutDragStart2: DeviceCoordinate {
123 | return DeviceCoordinate(x: 300, y: 1500, scaler: scaler)
124 | }
125 | var logoutDragEnd2: DeviceCoordinate {
126 | return DeviceCoordinate(x: 300, y: 500, scaler: scaler)
127 | }
128 | var logoutDarkBluePageBottomLeft: DeviceCoordinate {
129 | return DeviceCoordinate(x: 100, y: 1948, scaler: scaler)
130 | }
131 | var logoutDarkBluePageTopRight: DeviceCoordinate {
132 | return DeviceCoordinate(x: 1436, y: 100, scaler: scaler)
133 | }
134 |
135 | // MARK: - Pokemon Encounter
136 |
137 | var encounterPokemonUpperHigher: DeviceCoordinate {
138 | return DeviceCoordinate(x: 764, y: 1260, scaler: scaler)
139 | }
140 |
141 | var encounterPokemonUpper: DeviceCoordinate {
142 | return DeviceCoordinate(x: 764, y: 1300, scaler: scaler)
143 | }
144 | var encounterPokemonLower: DeviceCoordinate {
145 | return DeviceCoordinate(x: 764, y: 1331, scaler: scaler)
146 | }
147 | var encounterNoAR: DeviceCoordinate {
148 | return DeviceCoordinate(x: 0, y: 0, scaler: scaler)
149 | }
150 | var encounterNoARConfirm: DeviceCoordinate {
151 | return DeviceCoordinate(x: 0, y: 0, scaler: scaler)
152 | }
153 | var encounterTmp: DeviceCoordinate {
154 | return DeviceCoordinate(x: 0, y: 0, scaler: scaler)
155 | }
156 | var encounterPokemonRun: DeviceCoordinate {
157 | return DeviceCoordinate(x: 100, y: 170, scaler: scaler)
158 | }
159 | var encounterPokeball: DeviceCoordinate {
160 | return DeviceCoordinate(x: 1365, y: 1696, scaler: scaler)
161 | }
162 | var checkARPersistence: DeviceCoordinate {
163 | return DeviceCoordinate(x: 555, y: 100, scaler: scaler)
164 | }
165 |
166 | // MARK: - Pokestop Encounter
167 |
168 | var openPokestop: DeviceCoordinate {
169 | return DeviceCoordinate(x: 768, y: 922, scaler: scaler)
170 | }
171 | var rocketLogoGirl: DeviceCoordinate {
172 | return DeviceCoordinate(x: 867, y: 837, scaler: scaler)
173 | }
174 | var rocketLogoGuy: DeviceCoordinate {
175 | return DeviceCoordinate(x: 712, y: 830, scaler: scaler)
176 | }
177 | var closeInvasion: DeviceCoordinate {
178 | return DeviceCoordinate(x: 768, y: 2037, scaler: scaler)
179 | }
180 |
181 | // MARK: - Quest Clearing
182 |
183 | var openQuest: DeviceCoordinate {
184 | return DeviceCoordinate(x: 1445, y: 1750, scaler: scaler)
185 | }
186 | var questDelete: DeviceCoordinate {
187 | return DeviceCoordinate(x: 1434, y: 1272, scaler: scaler)
188 | }
189 | var questDeleteWithStack: DeviceCoordinate {
190 | return DeviceCoordinate(x: 1445, y: 1677, scaler: scaler)
191 | }
192 | var questDeleteConfirm: DeviceCoordinate {
193 | return DeviceCoordinate(x: 768, y: 1143, scaler: scaler)
194 | }
195 | var openItems: DeviceCoordinate {
196 | return DeviceCoordinate(x: 1165, y: 1620, scaler: scaler)
197 | }
198 | var questWillow: DeviceCoordinate {
199 | return DeviceCoordinate(x: 0, y: 0, scaler: scaler)
200 | }
201 | var questDeleteThirdSlot: DeviceCoordinate {
202 | return DeviceCoordinate(x: 1445, y: 2030, scaler: scaler) //not accurate
203 | }
204 |
205 | // MARK: - Item Clearing
206 |
207 | var itemDeleteIncrease: DeviceCoordinate {
208 | return DeviceCoordinate(x: 1128, y: 882, scaler: scaler)
209 | }
210 | var itemDeleteConfirm: DeviceCoordinate {
211 | return DeviceCoordinate(x: 768, y: 1362, scaler: scaler)
212 | }
213 | var itemDeleteX: Int {
214 | return scaler.scaleX(x: 1434)
215 | }
216 | var itemGiftX: Int {
217 | return scaler.scaleX(x: 296)
218 | }
219 | var itemEggX: Int {
220 | return scaler.scaleX(x: 325)
221 | }
222 | var itemEggMenuItem: DeviceCoordinate {
223 | //Anywhere in the first menu item Credit: @Bushe
224 | return DeviceCoordinate(x: 325, y: 325, scaler: scaler)
225 | }
226 | var itemEggDeploy: DeviceCoordinate {
227 | // Taps the egg to deploy (iPad needs to tap below the egg to deploy) Credit @Bushe
228 | return DeviceCoordinate(x: 768, y: 1500, scaler: scaler)
229 | }
230 | var itemDeleteYs: [Int] {
231 | return [
232 | scaler.scaleY(y: 483),
233 | scaler.scaleY(y: 992),
234 | scaler.scaleY(y: 1501),
235 | scaler.scaleY(y: 2010)
236 | ]
237 | }
238 | var itemIncenseYs: [Int] {
239 | return [
240 | scaler.scaleY(y: 0),
241 | scaler.scaleY(y: 0),
242 | scaler.scaleY(y: 0),
243 | scaler.scaleY(y: 0),
244 | scaler.scaleY(y: 0)
245 | ]
246 | }
247 | var itemFreePass: DeviceCoordinate {
248 | return DeviceCoordinate(x: 0, y: 0, scaler: scaler)
249 | }
250 | var itemGiftInfo: DeviceCoordinate {
251 | return DeviceCoordinate(x: 0, y: 0, scaler: scaler)
252 | }
253 |
254 | // MARK: - Login
255 |
256 | var loginNewPlayer: DeviceCoordinate {
257 | return DeviceCoordinate(x: 768, y: 1425, scaler: scaler)
258 | }
259 |
260 | var loginPTC: DeviceCoordinate {
261 | return DeviceCoordinate(x: 768, y: 1365, scaler: scaler)
262 | }
263 |
264 | var loginUsernameTextfield: DeviceCoordinate {
265 | return DeviceCoordinate(x: 768, y: 915, scaler: scaler)
266 | }
267 |
268 | var loginPasswordTextfield: DeviceCoordinate {
269 | return DeviceCoordinate(x: 768, y: 1100, scaler: scaler)
270 | }
271 |
272 | var loginConfirm: DeviceCoordinate {
273 | return DeviceCoordinate(x: 768, y: 1296, scaler: scaler)
274 | }
275 |
276 | var loginBannedBackground: DeviceCoordinate {
277 | return DeviceCoordinate(x: 189, y: 1551, scaler: scaler)
278 | }
279 |
280 | var loginBannedText: DeviceCoordinate {
281 | return DeviceCoordinate(x: 551, y: 796, scaler: scaler)
282 | }
283 |
284 | var loginBanned: DeviceCoordinate {
285 | return DeviceCoordinate(x: 780, y: 1030, scaler: scaler)
286 | }
287 |
288 | var loginBannedSwitchAccount: DeviceCoordinate {
289 | return DeviceCoordinate(x: 768, y: 1250, scaler: scaler)
290 | }
291 |
292 | var loginTermsText: DeviceCoordinate {
293 | return DeviceCoordinate(x: 258, y: 500, scaler: scaler)
294 | }
295 |
296 | var loginTerms: DeviceCoordinate {
297 | return DeviceCoordinate(x: 768, y: 1100, scaler: scaler)
298 | }
299 |
300 | var loginTerms2Text: DeviceCoordinate {
301 | return DeviceCoordinate(x: 382, y: 280, scaler: scaler)
302 | }
303 |
304 | var loginTerms2: DeviceCoordinate {
305 | return DeviceCoordinate(x: 768, y: 1050, scaler: scaler)
306 | }
307 |
308 | var loginFailedText: DeviceCoordinate {
309 | return DeviceCoordinate(x: 340, y: 732, scaler: scaler)
310 | }
311 |
312 | var loginFailed: DeviceCoordinate {
313 | return DeviceCoordinate(x: 768, y: 1200, scaler: scaler)
314 | }
315 |
316 | var loginPrivacyText: DeviceCoordinate {
317 | return DeviceCoordinate(x: 759, y: 1454, scaler: scaler)
318 | }
319 |
320 | var loginPrivacy: DeviceCoordinate {
321 | return DeviceCoordinate(x: 768, y: 1280, scaler: scaler)
322 | }
323 |
324 | var loginPrivacyUpdateText: DeviceCoordinate {
325 | return DeviceCoordinate(x: 270, y: 596, scaler: scaler)
326 | }
327 |
328 | var loginPrivacyUpdate: DeviceCoordinate {
329 | return DeviceCoordinate(x: 770, y: 1190, scaler: scaler)
330 | }
331 |
332 | var unableAuthText: DeviceCoordinate {
333 | return DeviceCoordinate(x: 0, y: 0, scaler: scaler)
334 | }
335 |
336 | var unableAuthButton: DeviceCoordinate {
337 | return DeviceCoordinate(x: 0, y: 0, scaler: scaler)
338 | }
339 |
340 | // MARK: - Tutorial
341 |
342 | var compareTutorialL: DeviceCoordinate {
343 | return DeviceCoordinate(x: 375, y: 1650, scaler: scaler)
344 | }
345 |
346 | var compareTutorialR: DeviceCoordinate {
347 | return DeviceCoordinate(x: 1150, y: 1650, scaler: scaler)
348 | }
349 |
350 | var tutorialNext: DeviceCoordinate {
351 | return DeviceCoordinate(x: 1400, y: 1949, scaler: scaler)
352 | }
353 |
354 | var tutorialBack: DeviceCoordinate {
355 | return DeviceCoordinate(x: 200, y: 1949, scaler: scaler)
356 | }
357 |
358 | var tutorialStyleDone: DeviceCoordinate {
359 | return DeviceCoordinate(x: 768, y: 1024, scaler: scaler)
360 | }
361 |
362 | var tutorialCatchOk: DeviceCoordinate {
363 | return DeviceCoordinate(x: 768, y: 1600, scaler: scaler)
364 | }
365 |
366 | var tutorialCatchClose: DeviceCoordinate {
367 | return DeviceCoordinate(x: 768, y: 1900, scaler: scaler)
368 | }
369 |
370 | var tutorialKeybordDone: DeviceCoordinate {
371 | return DeviceCoordinate(x: 0, y: 0, scaler: scaler)
372 | }
373 |
374 | var tutorialUsernameOk: DeviceCoordinate {
375 | return DeviceCoordinate(x: 0, y: 0, scaler: scaler)
376 | }
377 |
378 | var tutorialUsernameConfirm: DeviceCoordinate {
379 | return DeviceCoordinate(x: 0, y: 0, scaler: scaler)
380 | }
381 | var tutorialProfessorCheck: DeviceCoordinate {
382 | return DeviceCoordinate(x: 0, y: 0, scaler: scaler)
383 | }
384 | var tutorialSelectY: Int {
385 | return scaler.scaleY(y: 0)
386 | }
387 |
388 | var tutorialPhysicalXs: [Int] {
389 | return [
390 | scaler.scaleX(x: 0),
391 | scaler.scaleX(x: 0),
392 | scaler.scaleX(x: 0)
393 | ]
394 | }
395 |
396 | var tutorialHairXs: [Int] {
397 | return [
398 | scaler.scaleX(x: 0),
399 | scaler.scaleX(x: 0),
400 | scaler.scaleX(x: 0)
401 | ]
402 | }
403 |
404 | var tutorialEyeXs: [Int] {
405 | return [
406 | scaler.scaleX(x: 0),
407 | scaler.scaleX(x: 0),
408 | scaler.scaleX(x: 0)
409 | ]
410 | }
411 | var tutorialSkinXs: [Int] {
412 | return [
413 | scaler.scaleX(x: 0),
414 | scaler.scaleX(x: 0),
415 | scaler.scaleX(x: 0)
416 | ]
417 | }
418 |
419 | var tutorialStyleBack: DeviceCoordinate {
420 | return DeviceCoordinate(x: 0, y: 0, scaler: scaler)
421 | }
422 |
423 | var tutorialStyleChange: DeviceCoordinate {
424 | return DeviceCoordinate(x: 0, y: 0, scaler: scaler)
425 | }
426 |
427 | var tutorialInvalidUser: DeviceCoordinate {
428 | return DeviceCoordinate(x: 0, y: 0, scaler: scaler)
429 | }
430 |
431 | var tutorialUserTextbox: DeviceCoordinate {
432 | return DeviceCoordinate(x: 0, y: 0, scaler: scaler)
433 | }
434 |
435 | var tutorialMaleStyleXs: [Int] {
436 | return [
437 | scaler.scaleX(x: 0),
438 | scaler.scaleX(x: 0),
439 | scaler.scaleX(x: 0),
440 | scaler.scaleX(x: 0)
441 | ]
442 | }
443 |
444 | var tutorialFemaleStyleXs: [Int] {
445 | return [
446 | scaler.scaleX(x: 0),
447 | scaler.scaleX(x: 0),
448 | scaler.scaleX(x: 0),
449 | scaler.scaleX(x: 0)
450 | ]
451 | }
452 |
453 | var tutorialPoseAndBackpackX: Int {
454 | return scaler.scaleX(x: 0)
455 | }
456 |
457 | var tutorialSharedStyleXs: [Int] {
458 | return [
459 | scaler.scaleX(x: 0),
460 | scaler.scaleX(x: 0),
461 | scaler.scaleX(x: 0),
462 | scaler.scaleX(x: 0)
463 | ]
464 | }
465 |
466 | // MARK: - Adevture Sync
467 | var adventureSyncRewards: DeviceCoordinate {
468 | return DeviceCoordinate(x: 768, y: 500, scaler: scaler)
469 | }
470 | var adventureSyncButton: DeviceCoordinate {
471 | return DeviceCoordinate(x: 768, y: 1740, scaler: scaler)
472 | }
473 |
474 | // MARK: - Team Select
475 |
476 | var teamSelectBackgorundL: DeviceCoordinate {
477 | return DeviceCoordinate(x: 0, y: 0, scaler: scaler)
478 | }
479 |
480 | var teamSelectBackgorundR: DeviceCoordinate {
481 | return DeviceCoordinate(x: 0, y: 0, scaler: scaler)
482 | }
483 |
484 | var teamSelectNext: DeviceCoordinate {
485 | return DeviceCoordinate(x: 0, y: 0, scaler: scaler)
486 | }
487 |
488 | var teamSelectY: Int {
489 | return scaler.scaleY(y: 0)
490 | }
491 |
492 | var teamSelectWelcomeOk: DeviceCoordinate {
493 | return DeviceCoordinate(x: 0, y: 0, scaler: scaler)
494 | }
495 | }
496 |
--------------------------------------------------------------------------------
/RealDeviceMap-UIControl/DeviceConfig/DeviceRatio1775.swift:
--------------------------------------------------------------------------------
1 | //
2 | // DeviceRatio1775.swift
3 | // RealDeviceMap-UIControlUITests
4 | //
5 | // Created by Florian Kostenzer on 18.11.18.
6 | //
7 | // swiftlint:disable type_body_length file_length
8 | //
9 |
10 | import Foundation
11 | import XCTest
12 |
13 | class DeviceRatio1775: DeviceConfigProtocol {
14 |
15 | private var scaler: DeviceCoordinateScaler
16 | var tapScaler: Double
17 |
18 | required init(width: Int, height: Int, multiplier: Double=1.0, tapMultiplier: Double=1.0) {
19 | self.scaler = DeviceCoordinateScaler(
20 | widthNow: width,
21 | heightNow: height,
22 | widthTarget: 320,
23 | heightTarget: 568,
24 | multiplier: multiplier,
25 | tapMultiplier: tapMultiplier
26 | )
27 | self.tapScaler = tapMultiplier
28 | }
29 |
30 | // MARK: - Startup
31 |
32 | var startup: DeviceCoordinate {
33 | return DeviceCoordinate(x: 280, y: 800, scaler: scaler)
34 | }
35 | var startupLoggedOut: DeviceCoordinate {
36 | return DeviceCoordinate(x: 320, y: 175, scaler: scaler)
37 | }
38 | // Handling Multiple startup prompts
39 | var startupOldCornerTest: DeviceCoordinate {
40 | return DeviceCoordinate(x: 610, y: 715, scaler: scaler)
41 | }
42 | var startupOldOkButton: DeviceCoordinate {
43 | return DeviceCoordinate(x: 320, y: 650, scaler: scaler)
44 | }
45 | var startupNewButton: DeviceCoordinate {
46 | return DeviceCoordinate(x: 400, y: 820, scaler: scaler)
47 | }
48 | var startupNewCautionSign: DeviceCoordinate {
49 | return DeviceCoordinate(x: 320, y: 320, scaler: scaler)
50 | }
51 | //Find coords by scaling to 640x1136
52 | var ageVerification: DeviceCoordinate {
53 | return DeviceCoordinate(x: 222, y: 815, scaler: scaler)
54 | }
55 | var ageVerificationYear: DeviceCoordinate {
56 | return DeviceCoordinate(x: 475, y: 690, scaler: scaler)
57 | }
58 | var ageVerificationDragStart: DeviceCoordinate {
59 | return DeviceCoordinate(x: 475, y: 1025, scaler: scaler)
60 | }
61 | var ageVerificationDragEnd: DeviceCoordinate {
62 | return DeviceCoordinate(x: 475, y: 380, scaler: scaler)
63 | }
64 | var passenger: DeviceCoordinate {
65 | return DeviceCoordinate(x: 320, y: 775, scaler: scaler)
66 | }
67 | var weather: DeviceCoordinate {
68 | return DeviceCoordinate(x: 320, y: 780, scaler: scaler)
69 | }
70 | var closeWeather1: DeviceCoordinate {
71 | return DeviceCoordinate(x: 240, y: 975, scaler: scaler)
72 | }
73 | var closeWeather2: DeviceCoordinate {
74 | return DeviceCoordinate(x: 220, y: 1080, scaler: scaler)
75 | }
76 | var closeWarning: DeviceCoordinate {
77 | return DeviceCoordinate(x: 320, y: 960, scaler: scaler)
78 | }
79 | var closeNews: DeviceCoordinate {
80 | return DeviceCoordinate(x: 320, y: 960, scaler: scaler)
81 | }
82 | var compareWarningL: DeviceCoordinate {
83 | return DeviceCoordinate(x: 90, y: 950, scaler: scaler)
84 | }
85 | var compareWarningR: DeviceCoordinate {
86 | return DeviceCoordinate(x: 550, y: 950, scaler: scaler)
87 | }
88 | var closeFailedLogin: DeviceCoordinate {
89 | return DeviceCoordinate(x: 315, y: 665, scaler: scaler)
90 | }
91 |
92 | // MARK: - Misc
93 |
94 | var closeMenu: DeviceCoordinate {
95 | return DeviceCoordinate(x: 320, y: 1060, scaler: scaler)
96 | }
97 | var mainScreenPokeballRed: DeviceCoordinate {
98 | return DeviceCoordinate(x: 320, y: 1020, scaler: scaler)
99 | }
100 | var settingPageCloseButton: DeviceCoordinate {
101 | return DeviceCoordinate(x: 320, y: 1020, scaler: scaler)
102 | }
103 |
104 | // MARK: - Logout
105 |
106 | var settingsButton: DeviceCoordinate {
107 | return DeviceCoordinate(x: 600, y: 125, scaler: scaler)
108 | }
109 | var logoutDragStart: DeviceCoordinate {
110 | return DeviceCoordinate(x: 320, y: 900, scaler: scaler)
111 | }
112 | var logoutDragEnd: DeviceCoordinate {
113 | return DeviceCoordinate(x: 320, y: 100, scaler: scaler)
114 | }
115 | var logoutConfirm: DeviceCoordinate {
116 | return DeviceCoordinate(x: 320, y: 610, scaler: scaler)
117 | }
118 | var logoutCompareX: Int {
119 | return scaler.scaleY(y: 477)
120 | }
121 |
122 | var logoutDragStart2: DeviceCoordinate {
123 | return DeviceCoordinate(x: 320, y: 700, scaler: scaler)
124 | }
125 | var logoutDragEnd2: DeviceCoordinate {
126 | return DeviceCoordinate(x: 320, y: 500, scaler: scaler)
127 | }
128 |
129 | var logoutDarkBluePageBottomLeft: DeviceCoordinate {
130 | return DeviceCoordinate(x: 50, y: 1100, scaler: scaler)
131 | }
132 | var logoutDarkBluePageTopRight: DeviceCoordinate {
133 | return DeviceCoordinate(x: 620, y: 60, scaler: scaler)
134 | }
135 |
136 | // MARK: - Pokemon Encounter
137 |
138 | var encounterPokemonUpperHigher: DeviceCoordinate {
139 | return DeviceCoordinate(x: 320, y: 690, scaler: scaler)
140 | }
141 | var encounterPokemonUpper: DeviceCoordinate {
142 | return DeviceCoordinate(x: 320, y: 710, scaler: scaler)
143 | }
144 | var encounterPokemonLower: DeviceCoordinate {
145 | return DeviceCoordinate(x: 320, y: 730, scaler: scaler)
146 | }
147 | var encounterNoAR: DeviceCoordinate {
148 | return DeviceCoordinate(x: 312, y: 1070, scaler: scaler)
149 | }
150 | var encounterNoARConfirm: DeviceCoordinate {
151 | return DeviceCoordinate(x: 320, y: 645, scaler: scaler)
152 | }
153 | var encounterTmp: DeviceCoordinate {
154 | return DeviceCoordinate(x: 575, y: 107, scaler: scaler)
155 | }
156 | var encounterPokemonRun: DeviceCoordinate {
157 | return DeviceCoordinate(x: 50, y: 75, scaler: scaler)
158 | }
159 | var encounterPokeball: DeviceCoordinate {
160 | return DeviceCoordinate(x: 570, y: 990, scaler: scaler)
161 | }
162 | var checkARPersistence: DeviceCoordinate {
163 | return DeviceCoordinate(x: 557, y: 101, scaler: scaler)
164 | }
165 |
166 | // MARK: - Pokestop Encounter
167 |
168 | var openPokestop: DeviceCoordinate {
169 | return DeviceCoordinate(x: 320, y: 585, scaler: scaler)
170 | }
171 | var rocketLogoGirl: DeviceCoordinate {
172 | return DeviceCoordinate(x: 350, y: 500, scaler: scaler)
173 | }
174 | var rocketLogoGuy: DeviceCoordinate {
175 | return DeviceCoordinate(x: 254, y: 484, scaler: scaler)
176 | }
177 | var closeInvasion: DeviceCoordinate {
178 | return DeviceCoordinate(x: 320, y: 1000, scaler: scaler)
179 | }
180 |
181 | // MARK: - Quest Clearing
182 |
183 | var openQuest: DeviceCoordinate {
184 | return DeviceCoordinate(x: 590, y: 970, scaler: scaler)
185 | }
186 | var questDelete: DeviceCoordinate {
187 | return DeviceCoordinate(x: 596, y: 570, scaler: scaler)
188 | }
189 | var questDeleteWithStack: DeviceCoordinate {
190 | return DeviceCoordinate(x: 596, y: 739, scaler: scaler)
191 | }
192 | var questDeleteConfirm: DeviceCoordinate {
193 | return DeviceCoordinate(x: 320, y: 620, scaler: scaler)
194 | }
195 | var openItems: DeviceCoordinate {
196 | return DeviceCoordinate(x: 500, y: 950, scaler: scaler)
197 | }
198 | var questWillow: DeviceCoordinate {
199 | return DeviceCoordinate(x: 50, y: 1125, scaler: scaler)
200 | }
201 | var questDeleteThirdSlot: DeviceCoordinate {
202 | return DeviceCoordinate(x: 600, y: 860, scaler: scaler)
203 | }
204 |
205 | // MARK: - Item Clearing
206 |
207 | var itemDeleteIncrease: DeviceCoordinate {
208 | return DeviceCoordinate(x: 470, y: 510, scaler: scaler)
209 | }
210 | var itemDeleteConfirm: DeviceCoordinate {
211 | return DeviceCoordinate(x: 320, y: 710, scaler: scaler)
212 | }
213 | var itemDeleteX: Int {
214 | return scaler.scaleX(x: 585)
215 | }
216 | var itemGiftX: Int {
217 | return scaler.scaleX(x: 133)
218 | }
219 | var itemEggX: Int {
220 | return scaler.scaleX(x: 148)
221 | }
222 | var itemEggMenuItem: DeviceCoordinate {
223 | return DeviceCoordinate(x: 325, y: 225, scaler: scaler) //Anywhere in the first menu item
224 | }
225 | var itemEggDeploy: DeviceCoordinate {
226 | return DeviceCoordinate(x: 315, y: 880, scaler: scaler) // Taps the egg to deploy
227 | }
228 | var itemDeleteYs: [Int] {
229 | return [
230 | scaler.scaleY(y: 215),
231 | scaler.scaleY(y: 443),
232 | scaler.scaleY(y: 670),
233 | scaler.scaleY(y: 897),
234 | scaler.scaleY(y: 1124)
235 | ]
236 | }
237 | var itemIncenseYs: [Int] {
238 | return [
239 | scaler.scaleY(y: 232),
240 | scaler.scaleY(y: 460),
241 | scaler.scaleY(y: 687),
242 | scaler.scaleY(y: 914),
243 | scaler.scaleY(y: 1141)
244 | ]
245 | }
246 | var itemFreePass: DeviceCoordinate {
247 | return DeviceCoordinate(x: 320, y: 930, scaler: scaler)
248 | }
249 | var itemGiftInfo: DeviceCoordinate {
250 | return DeviceCoordinate(x: 320, y: 850, scaler: scaler)
251 | }
252 |
253 | // MARK: - Login
254 |
255 | var loginNewPlayer: DeviceCoordinate {
256 | return DeviceCoordinate(x: 320, y: 785, scaler: scaler)
257 | }
258 |
259 | var loginPTC: DeviceCoordinate {
260 | return DeviceCoordinate(x: 320, y: 700, scaler: scaler)
261 | }
262 |
263 | var loginUsernameTextfield: DeviceCoordinate {
264 | return DeviceCoordinate(x: 320, y: 500, scaler: scaler)
265 | }
266 |
267 | var loginPasswordTextfield: DeviceCoordinate {
268 | return DeviceCoordinate(x: 320, y: 600, scaler: scaler)
269 | }
270 |
271 | var loginConfirm: DeviceCoordinate {
272 | return DeviceCoordinate(x: 375, y: 680, scaler: scaler)
273 | }
274 |
275 | var loginBannedBackground: DeviceCoordinate {
276 | return DeviceCoordinate(x: 100, y: 900, scaler: scaler)
277 | }
278 |
279 | var loginBannedText: DeviceCoordinate {
280 | return DeviceCoordinate(x: 230, y: 473, scaler: scaler)
281 | }
282 |
283 | var loginBanned: DeviceCoordinate {
284 | return DeviceCoordinate(x: 320, y: 585, scaler: scaler)
285 | }
286 |
287 | var loginBannedSwitchAccount: DeviceCoordinate {
288 | return DeviceCoordinate(x: 320, y: 660, scaler: scaler)
289 | }
290 |
291 | var loginTermsText: DeviceCoordinate {
292 | return DeviceCoordinate(x: 109, y: 351, scaler: scaler)
293 | }
294 |
295 | var loginTerms: DeviceCoordinate {
296 | return DeviceCoordinate(x: 320, y: 615, scaler: scaler)
297 | }
298 |
299 | var loginTerms2Text: DeviceCoordinate {
300 | return DeviceCoordinate(x: 109, y: 374, scaler: scaler)
301 | }
302 |
303 | var loginTerms2: DeviceCoordinate {
304 | return DeviceCoordinate(x: 320, y: 620, scaler: scaler)
305 | }
306 |
307 | var loginFailedText: DeviceCoordinate {
308 | return DeviceCoordinate(x: 297, y: 526, scaler: scaler)
309 | }
310 |
311 | var loginFailed: DeviceCoordinate {
312 | return DeviceCoordinate(x: 320, y: 670, scaler: scaler)
313 | }
314 |
315 | var loginPrivacyText: DeviceCoordinate {
316 | return DeviceCoordinate(x: 328, y: 748, scaler: scaler)
317 | }
318 |
319 | var loginPrivacy: DeviceCoordinate {
320 | return DeviceCoordinate(x: 320, y: 625, scaler: scaler)
321 | }
322 |
323 | var loginPrivacyUpdateText: DeviceCoordinate {
324 | return DeviceCoordinate(x: 110, y: 389, scaler: scaler)
325 | }
326 |
327 | var loginPrivacyUpdate: DeviceCoordinate {
328 | return DeviceCoordinate(x: 320, y: 625, scaler: scaler)
329 | }
330 |
331 | var unableAuthText: DeviceCoordinate {
332 | return DeviceCoordinate(x: 330, y: 530, scaler: scaler)
333 | }
334 |
335 | var unableAuthButton: DeviceCoordinate {
336 | return DeviceCoordinate(x: 320, y: 585, scaler: scaler)
337 | }
338 |
339 | // MARK: - Tutorial
340 |
341 | var compareTutorialL: DeviceCoordinate {
342 | return DeviceCoordinate(x: 100, y: 900, scaler: scaler)
343 | }
344 |
345 | var compareTutorialR: DeviceCoordinate {
346 | return DeviceCoordinate(x: 550, y: 900, scaler: scaler)
347 | }
348 |
349 | var tutorialNext: DeviceCoordinate {
350 | return DeviceCoordinate(x: 565, y: 1085, scaler: scaler)
351 | }
352 |
353 | var tutorialStyleDone: DeviceCoordinate {
354 | return DeviceCoordinate(x: 320, y: 610, scaler: scaler)
355 | }
356 |
357 | var tutorialCatchOk: DeviceCoordinate {
358 | return DeviceCoordinate(x: 320, y: 750, scaler: scaler)
359 | }
360 |
361 | var tutorialCatchClose: DeviceCoordinate {
362 | return DeviceCoordinate(x: 320, y: 1050, scaler: scaler)
363 | }
364 |
365 | var tutorialKeybordDone: DeviceCoordinate {
366 | return DeviceCoordinate(x: 550, y: 1075, scaler: scaler)
367 | }
368 |
369 | var tutorialUsernameOk: DeviceCoordinate {
370 | return DeviceCoordinate(x: 320, y: 770, scaler: scaler)
371 | }
372 |
373 | var tutorialUsernameConfirm: DeviceCoordinate {
374 | return DeviceCoordinate(x: 320, y: 620, scaler: scaler)
375 | }
376 |
377 | var tutorialProfessorCheck: DeviceCoordinate {
378 | return DeviceCoordinate(x: 390, y: 866, scaler: scaler)
379 | }
380 |
381 | var tutorialSelectY: Int {
382 | return scaler.scaleY(y: 930)
383 | }
384 | var tutorialBack: DeviceCoordinate {
385 | return DeviceCoordinate(x: 75, y: 1085, scaler: scaler)
386 | }
387 |
388 | var tutorialPhysicalXs: [Int] {
389 | return [
390 | scaler.scaleX(x: 150),
391 | scaler.scaleX(x: 320),
392 | scaler.scaleX(x: 490)
393 | ]
394 | }
395 |
396 | var tutorialHairXs: [Int] {
397 | return [
398 | scaler.scaleX(x: 35),
399 | scaler.scaleX(x: 350),
400 | scaler.scaleX(x: 530)
401 | ]
402 | }
403 |
404 | var tutorialEyeXs: [Int] {
405 | return [
406 | scaler.scaleX(x: 265),
407 | scaler.scaleX(x: 440),
408 | scaler.scaleX(x: 615)
409 |
410 | ]
411 | }
412 |
413 | var tutorialSkinXs: [Int] {
414 | return [
415 | scaler.scaleX(x: 40),
416 | scaler.scaleX(x: 390),
417 | scaler.scaleX(x: 570)
418 | ]
419 | }
420 |
421 | var tutorialStyleBack: DeviceCoordinate {
422 | return DeviceCoordinate(x: 320, y: 1085, scaler: scaler)
423 | }
424 |
425 | var tutorialStyleChange: DeviceCoordinate {
426 | return DeviceCoordinate(x: 320, y: 760, scaler: scaler)
427 | }
428 |
429 | var tutorialMaleStyleXs: [Int] {
430 | return [
431 | scaler.scaleX(x: 95),
432 | scaler.scaleX(x: 230),
433 | scaler.scaleX(x: 365),
434 | scaler.scaleX(x: 500)
435 | ]
436 | }
437 |
438 | var tutorialSharedStyleXs: [Int] {
439 | return [
440 | scaler.scaleX(x: 85),
441 | scaler.scaleX(x: 260),
442 | scaler.scaleX(x: 450),
443 | scaler.scaleX(x: 620)
444 | ]
445 | }
446 |
447 | var tutorialFemaleStyleXs: [Int] {
448 | return [
449 | scaler.scaleX(x: 95),
450 | scaler.scaleX(x: 230),
451 | scaler.scaleX(x: 500),
452 | scaler.scaleX(x: 625)
453 | ]
454 | }
455 |
456 | var tutorialPoseAndBackpackX: Int {
457 | return scaler.scaleX(x: 320)
458 | }
459 |
460 | // MARK: - Adevture Sync
461 | var adventureSyncRewards: DeviceCoordinate {
462 | return DeviceCoordinate(x: 320, y: 300, scaler: scaler)
463 | }
464 | var adventureSyncButton: DeviceCoordinate {
465 | return DeviceCoordinate(x: 320, y: 978, scaler: scaler)
466 | }
467 |
468 | // MARK: - Team Select
469 |
470 | var teamSelectBackgorundL: DeviceCoordinate {
471 | return DeviceCoordinate(x: 100, y: 800, scaler: scaler)
472 | }
473 |
474 | var teamSelectBackgorundR: DeviceCoordinate {
475 | return DeviceCoordinate(x: 550, y: 800, scaler: scaler)
476 | }
477 |
478 | var teamSelectNext: DeviceCoordinate {
479 | return DeviceCoordinate(x: 550, y: 1055, scaler: scaler)
480 | }
481 |
482 | var teamSelectY: Int {
483 | return scaler.scaleY(y: 700)
484 | }
485 |
486 | var teamSelectWelcomeOk: DeviceCoordinate {
487 | return DeviceCoordinate(x: 320, y: 610, scaler: scaler)
488 | }
489 |
490 | }
491 |
--------------------------------------------------------------------------------
/RealDeviceMap-UIControl/DeviceCoordinate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // DeviceCoordinate.swift
3 | // RealDeviceMap-UIControlUITests
4 | //
5 | // Created by Florian Kostenzer on 18.11.18.
6 | //
7 |
8 | import Foundation
9 | import XCTest
10 |
11 | struct DeviceCoordinate {
12 |
13 | public var x: Int
14 | public var y: Int
15 | public var tapx: Int
16 | public var tapy: Int
17 |
18 | public init(x: Int, y: Int, tapScaler: Double) {
19 | self.x = x
20 | self.y = y
21 | self.tapx = lround(Double(x) * tapScaler)
22 | self.tapy = lround(Double(y) * tapScaler)
23 | }
24 |
25 | public init(x: Int, y: Int, scaler: DeviceCoordinateScaler) {
26 | self.x = scaler.scaleX(x: x)
27 | self.y = scaler.scaleY(y: y)
28 | self.tapx = scaler.tapScaleX(x: x)
29 | self.tapy = scaler.tapScaleY(y: y)
30 | }
31 |
32 | public func toXCUICoordinate(app: XCUIApplication) -> XCUICoordinate {
33 | return app.coordinate(withNormalizedOffset: CGVector.zero).withOffset(CGVector(dx: tapx, dy: tapy))
34 | }
35 |
36 | public func toXY() -> (x: Int, y: Int) {
37 | return (x, y)
38 | }
39 |
40 | }
41 |
42 | struct DeviceCoordinateScaler {
43 |
44 | public var widthNow: Int
45 | public var heightNow: Int
46 | public var widthTarget: Int
47 | public var heightTarget: Int
48 | public var multiplier: Double
49 | public var tapMultiplier: Double
50 |
51 | public func scaleX(x: Int) -> Int {
52 | return lround(Double(x) * Double(widthNow) / Double(widthTarget) * multiplier)
53 | }
54 |
55 | public func scaleY(y: Int) -> Int {
56 | return lround(Double(y) * Double(heightNow) / Double(heightTarget) * multiplier)
57 | }
58 |
59 | public func tapScaleX(x: Int) -> Int {
60 | return lround(Double(x) * Double(widthNow) / Double(widthTarget) * multiplier * tapMultiplier )
61 | }
62 |
63 | public func tapScaleY(y: Int) -> Int {
64 | return lround(Double(y) * Double(heightNow) / Double(heightTarget) * multiplier * tapMultiplier )
65 | }
66 |
67 | }
68 |
--------------------------------------------------------------------------------
/RealDeviceMap-UIControl/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 |
22 |
23 |
--------------------------------------------------------------------------------
/RealDeviceMap-UIControl/Log.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Log.swift
3 | // RealDeviceMap-UIControlUITests
4 | //
5 | // Created by Florian Kostenzer on 18.11.18.
6 | //
7 |
8 | import Foundation
9 |
10 | class Log {
11 |
12 | private init() {}
13 |
14 | public static func error(_ message: String) {
15 | print("[ERROR] \(message)")
16 | }
17 |
18 | public static func info(_ message: String) {
19 | print("[INFO] \(message)")
20 | }
21 |
22 | public static func debug(_ message: String) {
23 | print("[DEBUG] \(message)")
24 | }
25 |
26 | public static func test(_ message: String) {
27 | print("[Verbose] \(message)")
28 | }
29 |
30 | public static func startup(_ message: String) {
31 | print("[Startup] \(message)")
32 | }
33 |
34 | public static func tutorial(_ message: String) {
35 | print("[Tutorial] \(message)")
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/Unused/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // RealDeviceMap-UIControl
4 | //
5 | // Created by Florian Kostenzer on 28.09.18.
6 | //
7 |
8 | import UIKit
9 |
10 | @UIApplicationMain
11 | class AppDelegate: UIResponder, UIApplicationDelegate {
12 |
13 | var window: UIWindow?
14 |
15 | /*func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
16 | // Override point for customization after application launch.
17 | return true
18 | }
19 |
20 | func applicationWillResignActive(_ application: UIApplication) {
21 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
22 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
23 | }
24 |
25 | func applicationDidEnterBackground(_ application: UIApplication) {
26 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
27 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
28 | }
29 |
30 | func applicationWillEnterForeground(_ application: UIApplication) {
31 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
32 | }
33 |
34 | func applicationDidBecomeActive(_ application: UIApplication) {
35 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
36 | }
37 |
38 | func applicationWillTerminate(_ application: UIApplication) {
39 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
40 | }*/
41 |
42 |
43 | }
44 |
45 |
--------------------------------------------------------------------------------
/Unused/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "20x20",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "20x20",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "29x29",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "29x29",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "40x40",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "40x40",
31 | "scale" : "3x"
32 | },
33 | {
34 | "idiom" : "iphone",
35 | "size" : "60x60",
36 | "scale" : "2x"
37 | },
38 | {
39 | "idiom" : "iphone",
40 | "size" : "60x60",
41 | "scale" : "3x"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "size" : "20x20",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "ipad",
50 | "size" : "20x20",
51 | "scale" : "2x"
52 | },
53 | {
54 | "idiom" : "ipad",
55 | "size" : "29x29",
56 | "scale" : "1x"
57 | },
58 | {
59 | "idiom" : "ipad",
60 | "size" : "29x29",
61 | "scale" : "2x"
62 | },
63 | {
64 | "idiom" : "ipad",
65 | "size" : "40x40",
66 | "scale" : "1x"
67 | },
68 | {
69 | "idiom" : "ipad",
70 | "size" : "40x40",
71 | "scale" : "2x"
72 | },
73 | {
74 | "idiom" : "ipad",
75 | "size" : "76x76",
76 | "scale" : "1x"
77 | },
78 | {
79 | "idiom" : "ipad",
80 | "size" : "76x76",
81 | "scale" : "2x"
82 | },
83 | {
84 | "idiom" : "ipad",
85 | "size" : "83.5x83.5",
86 | "scale" : "2x"
87 | },
88 | {
89 | "idiom" : "ios-marketing",
90 | "size" : "1024x1024",
91 | "scale" : "1x"
92 | }
93 | ],
94 | "info" : {
95 | "version" : 1,
96 | "author" : "xcode"
97 | }
98 | }
--------------------------------------------------------------------------------
/Unused/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/Unused/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Unused/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/Unused/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 | LSRequiresIPhoneOS
22 |
23 | UILaunchStoryboardName
24 | LaunchScreen
25 | UIMainStoryboardFile
26 | Main
27 | UIRequiredDeviceCapabilities
28 |
29 | armv7
30 |
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 | UIInterfaceOrientationLandscapeLeft
35 | UIInterfaceOrientationLandscapeRight
36 |
37 | UISupportedInterfaceOrientations~ipad
38 |
39 | UIInterfaceOrientationPortrait
40 | UIInterfaceOrientationPortraitUpsideDown
41 | UIInterfaceOrientationLandscapeLeft
42 | UIInterfaceOrientationLandscapeRight
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/Unused/ViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.swift
3 | // RealDeviceMap-UIControl
4 | //
5 | // Created by Florian Kostenzer on 28.09.18.
6 | //
7 |
8 | import UIKit
9 |
10 | class ViewController: UIViewController {
11 |
12 | override func viewDidLoad() {
13 | super.viewDidLoad()
14 | // Do any additional setup after loading the view, typically from a nib.
15 | }
16 |
17 |
18 | }
19 |
20 |
--------------------------------------------------------------------------------