Skip to content

Commit c576fd1

Browse files
fr0l-bmblGitHub Enterprise
authored andcommitted
Merge pull request #1 from mre/BPAppBootstrap_logs
BPAppBootstrap + MJPEG scaling
2 parents 31c9008 + b1a3e6b commit c576fd1

File tree

22 files changed

+269
-15
lines changed

22 files changed

+269
-15
lines changed

DeviceAgent.xcodeproj/project.pbxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
1F8EDBBA2AB8F8CF000D81ED /* CBXScreenshooter.m in Sources */ = {isa = PBXBuildFile; fileRef = 1F1D9EEC2AB5C261003C1260 /* CBXScreenshooter.m */; };
8484
1F8EDBBB2AB8F8D9000D81ED /* CBXScreenshooter.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F1D9EEB2AB5C261003C1260 /* CBXScreenshooter.h */; };
8585
1F8EDBBC2AB8F8DA000D81ED /* CBXScreenshooter.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F1D9EEB2AB5C261003C1260 /* CBXScreenshooter.h */; };
86-
1FE0A2E72B9FBCB5006F9C7B /* BPAppBootstrap.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 1FE0A2E52B9FBC9D006F9C7B /* BPAppBootstrap.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
86+
1FE2978E2BA0887300F5E411 /* BPAppBootstrap.xcframework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 1FE2978C2BA0884800F5E411 /* BPAppBootstrap.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
8787
3B5444E52498241500532AE0 /* QuerySpecifierByDescendantType.h in Headers */ = {isa = PBXBuildFile; fileRef = 3B81F693240E937F00825603 /* QuerySpecifierByDescendantType.h */; };
8888
3B5444EA249838AC00532AE0 /* QuerySpecifierTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 3B5444E02498216000532AE0 /* QuerySpecifierTests.m */; };
8989
3B81F695240E952F00825603 /* QuerySpecifierByDescendantType.m in Sources */ = {isa = PBXBuildFile; fileRef = 3B81F694240E952F00825603 /* QuerySpecifierByDescendantType.m */; };
@@ -1347,7 +1347,7 @@
13471347
dstPath = "";
13481348
dstSubfolderSpec = 10;
13491349
files = (
1350-
1FE0A2E72B9FBCB5006F9C7B /* BPAppBootstrap.framework in CopyFiles */,
1350+
1FE2978E2BA0887300F5E411 /* BPAppBootstrap.xcframework in CopyFiles */,
13511351
84A10D982679A474004446C7 /* CocoaLumberjack.xcframework in CopyFiles */,
13521352
);
13531353
runOnlyForDeploymentPostprocessing = 0;
@@ -1590,7 +1590,7 @@
15901590
1F2A5F912ABAD4A5000FD13A /* QuerySpecifierByPredicate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QuerySpecifierByPredicate.m; sourceTree = "<group>"; };
15911591
1F8EDBB52AB8F34A000D81ED /* FBMjpegServer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FBMjpegServer.h; sourceTree = "<group>"; };
15921592
1F8EDBB62AB8F34A000D81ED /* FBMjpegServer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBMjpegServer.m; sourceTree = "<group>"; };
1593-
1FE0A2E52B9FBC9D006F9C7B /* BPAppBootstrap.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = BPAppBootstrap.framework; sourceTree = "<group>"; };
1593+
1FE2978C2BA0884800F5E411 /* BPAppBootstrap.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = BPAppBootstrap.xcframework; sourceTree = "<group>"; };
15941594
3B5444E02498216000532AE0 /* QuerySpecifierTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = QuerySpecifierTests.m; sourceTree = "<group>"; };
15951595
3B81F693240E937F00825603 /* QuerySpecifierByDescendantType.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = QuerySpecifierByDescendantType.h; sourceTree = "<group>"; };
15961596
3B81F694240E952F00825603 /* QuerySpecifierByDescendantType.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = QuerySpecifierByDescendantType.m; sourceTree = "<group>"; };
@@ -2948,7 +2948,7 @@
29482948
F55F7FEA1C6DD07500A945C8 /* Vendor */ = {
29492949
isa = PBXGroup;
29502950
children = (
2951-
1FE0A2E52B9FBC9D006F9C7B /* BPAppBootstrap.framework */,
2951+
1FE2978C2BA0884800F5E411 /* BPAppBootstrap.xcframework */,
29522952
F54063ED1EBB344200C80B4E /* FLWebView */,
29532953
F55F7FEB1C6DD07500A945C8 /* CocoaAsyncSocket */,
29542954
F55F7FEF1C6DD07500A945C8 /* CocoaHTTPServer */,

DeviceAgent.xcworkspace/xcshareddata/xcschemes/DeviceAgent.xcscheme

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,20 @@
2525
</ExecutionAction>
2626
</PostActions>
2727
<BuildActionEntries>
28+
<BuildActionEntry
29+
buildForTesting = "YES"
30+
buildForRunning = "YES"
31+
buildForProfiling = "YES"
32+
buildForArchiving = "YES"
33+
buildForAnalyzing = "YES">
34+
<BuildableReference
35+
BuildableIdentifier = "primary"
36+
BlueprintIdentifier = "898743BB1C5847B30084FD93"
37+
BuildableName = "AppStub.app"
38+
BlueprintName = "AppStub"
39+
ReferencedContainer = "container:DeviceAgent.xcodeproj">
40+
</BuildableReference>
41+
</BuildActionEntry>
2842
<BuildActionEntry
2943
buildForTesting = "YES"
3044
buildForRunning = "YES"
@@ -89,15 +103,6 @@
89103
savedToolIdentifier = ""
90104
useCustomWorkingDirectory = "NO"
91105
debugDocumentVersioning = "YES">
92-
<MacroExpansion>
93-
<BuildableReference
94-
BuildableIdentifier = "primary"
95-
BlueprintIdentifier = "898743D41C5847B30084FD93"
96-
BuildableName = "DeviceAgent.xctest"
97-
BlueprintName = "DeviceAgent"
98-
ReferencedContainer = "container:DeviceAgent.xcodeproj">
99-
</BuildableReference>
100-
</MacroExpansion>
101106
</ProfileAction>
102107
<AnalyzeAction
103108
buildConfiguration = "Debug">

Server/FBMjpegServer.m

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
#import "Testmanagerd.h"
1717
#import "XCUIScreen.h"
1818
#import "CBXScreenshooter.h"
19+
#import <ImageIO/ImageIO.h>
20+
#import <UIKit/UIKit.h>
1921

2022
static const NSUInteger MAX_FPS = 60;
2123
static NSString *const SERVER_NAME = @"WDA MJPEG Server";
@@ -80,7 +82,31 @@ - (void)streamScreenshot
8082
}
8183

8284
@try {
83-
[self sendScreenshot:[_screenshooter getScreenshotData]];
85+
NSData *screenShotData = [_screenshooter getScreenshotData];
86+
CGFloat scalingFactor = 50 / 100.0;
87+
CGFloat compressionQuality = 0.8;
88+
89+
UIImage *image = [UIImage imageWithData:screenShotData];
90+
CGSize scaledSize = CGSizeMake(image.size.width * scalingFactor, image.size.height * scalingFactor);
91+
92+
dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
93+
__block UIImage *scaledImage = nil;
94+
[image prepareThumbnailOfSize:scaledSize completionHandler:^(UIImage * _Nullable thumbnail) {
95+
scaledImage = thumbnail;
96+
dispatch_semaphore_signal(semaphore);
97+
}];
98+
dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER);
99+
100+
if (nil == scaledImage) {
101+
NSLog(@"Screenshot exception: Failed to scale image using prepareThumbnailOfSize");
102+
} else {
103+
NSData *scaledImageData = UIImageJPEGRepresentation(scaledImage, compressionQuality);
104+
if (nil == scaledImageData) {
105+
NSLog(@"Screenshot exception: Failed to scale image using UIImageJPEGRepresentation");
106+
} else {
107+
[self sendScreenshot:scaledImageData];
108+
}
109+
}
84110
} @catch (NSException *exception) {
85111
NSLog(@"Screenshot exception: %@, %@", exception.name, exception.reason);
86112
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>AvailableLibraries</key>
6+
<array>
7+
<dict>
8+
<key>BinaryPath</key>
9+
<string>BPAppBootstrap.framework/BPAppBootstrap</string>
10+
<key>DebugSymbolsPath</key>
11+
<string>dSYMs</string>
12+
<key>LibraryIdentifier</key>
13+
<string>ios-arm64_x86_64-simulator</string>
14+
<key>LibraryPath</key>
15+
<string>BPAppBootstrap.framework</string>
16+
<key>SupportedArchitectures</key>
17+
<array>
18+
<string>arm64</string>
19+
<string>x86_64</string>
20+
</array>
21+
<key>SupportedPlatform</key>
22+
<string>ios</string>
23+
<key>SupportedPlatformVariant</key>
24+
<string>simulator</string>
25+
</dict>
26+
<dict>
27+
<key>BinaryPath</key>
28+
<string>BPAppBootstrap.framework/BPAppBootstrap</string>
29+
<key>DebugSymbolsPath</key>
30+
<string>dSYMs</string>
31+
<key>LibraryIdentifier</key>
32+
<string>ios-arm64</string>
33+
<key>LibraryPath</key>
34+
<string>BPAppBootstrap.framework</string>
35+
<key>SupportedArchitectures</key>
36+
<array>
37+
<string>arm64</string>
38+
</array>
39+
<key>SupportedPlatform</key>
40+
<string>ios</string>
41+
</dict>
42+
</array>
43+
<key>CFBundlePackageType</key>
44+
<string>XFWK</string>
45+
<key>XCFrameworkFormatVersion</key>
46+
<string>1.0</string>
47+
</dict>
48+
</plist>
Binary file not shown.
Binary file not shown.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>English</string>
7+
<key>CFBundleIdentifier</key>
8+
<string>com.apple.xcode.dsym.com.badoo.BPAppBootstrap</string>
9+
<key>CFBundleInfoDictionaryVersion</key>
10+
<string>6.0</string>
11+
<key>CFBundlePackageType</key>
12+
<string>dSYM</string>
13+
<key>CFBundleSignature</key>
14+
<string>????</string>
15+
<key>CFBundleShortVersionString</key>
16+
<string>1.0</string>
17+
<key>CFBundleVersion</key>
18+
<string>1</string>
19+
</dict>
20+
</plist>

0 commit comments

Comments
 (0)