Unable to start APK on android emulator using Katalon Mobile Recorder or Object Spy

Hi @satish1607,

That is a weird issue. When you say the apk is corrupted, are you saying that after you try to Record or Spy Mobile, you can’t open the apk any more on your device or simulator, even after quitting Katalon Studio?

– Chris

Thanks for the quick help.

Yes after use of Record or Spy, it was corrupting the apk. As you suggested above to use noSign looks like problem is resolved. Let me test everything then will update on this. When I used noSign as Boolean and False then also it was corrupting not I have changed to Bollean and true now its not corrupting.

Will update you on this after testing.
Thanks again.

Hi @satish1607,

I think I got my true/false mixed up. noSign should be true to prevent signing. Sorry about that.

Here’s a full list of the Appium Desired Capabilities for reference:

http://appium.io/docs/en/writing-running-appium/caps/

– Chris

Just one quick check, in my application when I tap on login button manually I am able to login but when I tap using Katalon studio then its saying server not found and its not logging in. Why katalon is behaving differently.

@satish1607,

Is the app showing an Android error dialog saying “server not found”, or is it a Katalon Studio error saying “server not found”? Can you share a screenshot of that error?

– Chris

Its from the android not from the Katalon, when I close and reopen the application then I am able to login. But when I try to login with Katalon studio then its saying server not found

@satish1607,

That isn’t something I’ve encountered before. Are you able to inspect the network connection of the Android app to see what URLs it’s trying to hit, both when you are running it on its own and through Katalon? I’m wondering if for some reason they are trying to hit different login APIs depending on how the app is run.

You could use a tool like Charles Proxy to check the outgoing traffic.

– Chris

Thanks for the replay, let me do little research then update you. In simple term I am unable to login with katalon script. Is there any other way to launch the application apart from “Start Application” with script?

You can see in picture one when trying with script its showing “Error when login, Please try again”,. Manually I closed and reopen the application then login works correctly.

Hi @satish1607,

That is indeed very weird. Is it possible that you’re using a different username and password for the test versus when you login manually?

If you already have the app installed on your device, you can try to start the application in a different way by faking out the startApplication call with another apk (like the one from the Android Sample Tests).

See here for an example:

– Chris

Hi Chris,
Unfortunately above solution does not worked for me, I am facing the same problem. I am attaching my script and URL to download application (Same Application I am using) from google Play store. Please download it register it and have a look why login is not working.

Hi @satish1607,

Did you get the version of the app that you’re testing from the Google Play store or do you have a development build?

I downloaded the apk and installed it on an emulator, but I receive an error about a rooted device being detected. I’m guessing that this is because the emulator is running as root and perhaps the Play Store version doesn’t allow running on rooted devices.

I made your script a little simpler by cutting out some of the repeated steps. Script.txt (2.2 KB)

– Chris

Thanks a lot for your update, actually both the script (mine and yours) started working. Your script is also doing the same task but in faster manner that’s Great. I will be going to use the script provided by you.

Thanks a lot for your kind and quick help :slight_smile:

Please do let me know how do I identify some object/ buttons which is not able to recognised by SpyMobile like Verify Account, Resend Verification code and Other verification options button

Hi @satish1607,

When you say the objects are not recognized by Spy Mobile, do you mean that the capture screen is blank? This can happen when a developer sets a particular screen in an Android app as “secure”. That means that the screenshots can’t be taken of the screen, and since screenshots are how the Spy Mobile capture shows you what’s on the app, you don’t see anything. This usually happens on login, password, or credit card screens.

While the preview of the screen doesn’t show, you can still capture the objects using the object hierarchy (you just won’t see a preview of the item you’re selecting on the screen).

Hope this helps,

Chris

I mean screen is coming with button and all object but its considering whole screen as one object instead of multiple buttons, edit box etc. This out layer in colour one you can see on screenshot. When I click on verify button its not recognising instead it will high light the whole colour area.

Hi @satish1607,

Sometimes the layout of the app overlays certain views so that clicking on the “Device View” window isn’t very helpful.

If you can navigate the object tree in the “All Objects” section, when you click the object from that list (you might have to use a little guess work to find the right one) you should see the correct element highlighted in the “Device View”.

You can then click the checkbox to the left of the element in the “All Objects” section to prepare the element to be saved.

Hope this helps,

Chris

Thanks Chris I am able to find the objects elements from the above guide.

Thanks Cheers.

1 Like

Hi,

I’m new at katalon studio and also encountered this issue.

Uploading: image.png…

Asking for your help to fix this.

thanks you.

Hello mr Chris.

I wanna ask something, i just try katalon studio for mobile testing and it works.
But unfortunately, one of my apk testing isnt running well. The case is : when i try to record the apk, its stuck on splash screen on first launch the app. I wanna ask to you, can i test that apk with katalon? Or i should set up something to handle that? Thankyou

Hi @silmi,

The problem you’re seeing might be that Katalon is launching the wrong activity for your app and is hanging at the splash screen. You can try setting the Desired Capabilities for the appActivity to be the correct application activity (you might need to confirm that value with your developers).

See here for how to set the Desired Capabilities in Katalon Studio:

Hope this helps,

Chris

To address APK file corruption issues:

  1. Rebuild APK: Rebuild the APK from source code using proper build tools.
  2. Check for Malicious Code: Run a security scan on code to detect spyware or malicious elements.
  3. Review Dependencies: Ensure all project dependencies are updated and compatible.
  4. Investigate Recorder: Check if recorders are affecting or modifying the APK file.
  5. Verify Copying Process: Ensure correct copying and storage processes for the APK file.
  6. Update Tools: Use the latest versions of development tools to benefit from bug fixes.
  7. Test on Different Devices: Confirm if the issue persists across various devices.
  8. Explore Alternatives: Consider alternative build methods or tools for APK creation.

For further assistance, provide specific details or consult relevant forums.