简体   繁体   中英

Take screenshot of iOS device by code (not swift or xamarin)

I'm working on verifying screen of the iOS app by using tesseract engine (OCR). I'm using Ranorex (Test automation tool) that use .net 4.5 frame.

MobileApp targetApp = repo.App;
    Bitmap actualImage = Imaging.CaptureImage(targetApp,0,true);

I used above code to get a bitmap of the current screen. However, the resolution is too low to run OCR. Therefore, I need to work on the other ways.

1st: If Ranorex has some function that takes high resolution of the screen image.

2nd: If there is c#(.net frame 4.5) code that can get high resolution of the screen image.

3rd: Find a tool to take a screen shot of iPad app (external tool), and save all high resolution screen shot first, and read the file by bitmap(C:\\xxxx).

It would be great if I can get a good suggestion.

Thank you for helping me.

You can take screenshots using the UIAutomation framework from Apple.

You can use this code to generate screen shots:

target.captureScreenWithName("HomeScreen");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM