1

I'd like to know if it is possible to run an Android app in a real device with a specific API level.

I have a Moto G 2nd Generation running Lollipop and I want to test how the app would run in previous versions of Android.

Is it possible?

Thanks in advance

2
  • You want to test the app on a phone that has api 21, but yout want it to behave like it has lower api level? Like simulate lower api level on a device that has level 21? Commented Mar 29, 2015 at 22:17
  • Yes, that's what I want to do Commented Mar 29, 2015 at 22:17

2 Answers 2

3

You can't downgrade the Android OS on a device for testing without reinstalling the OS. For test purposes, you should use an emulator or another device running older version of Android.

Sign up to request clarification or add additional context in comments.

4 Comments

The thing is, I want to test different styles, layouts, etc. for different API levels. I could this manually by removing the newer ones, but this is quite ugly, so isn't there a good way to do it?
You're probably looking for Multi configuration preview. But that's for one API level only but you can test your layout on different screen sizes. developer.android.com/sdk/installing/studio-tips.html (See under Creative layout)
That is partially useful. I also would like to test things like the behaviour of a button when is pressed
I think your best bet for checking behavior would be to write it as an Espresso (UI) test and run it on different emulator configurations. There are some companies that also allow you to run tests on their cloud of devices for free or cheap -- testdroid.com appthwack.com
1

Ok, I don't think you can do that. But for those purposes you can take genymotion for example. There are a lot of device images that you can virtualy run and test your app.

If an emulator doesn't have all the things you need, then the only thing is to get people with older devices and test on them

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.